Skip to content

Commit

Permalink
Create a custom error when plugin is not found. (#409)
Browse files Browse the repository at this point in the history
Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net>
  • Loading branch information
AbdelStark authored Feb 18, 2020
1 parent c38152a commit 8afd651
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public JsonRpcResponse response(final JsonRpcRequestContext requestContext) {
"Plugin cannot be reloaded because no plugin has been registered with specified name: {}.",
pluginName);
return new JsonRpcErrorResponse(
requestContext.getRequest().getId(), JsonRpcError.INTERNAL_ERROR);
requestContext.getRequest().getId(), JsonRpcError.PLUGIN_NOT_FOUND);
}
reloadPluginConfig(namedPlugins.get(pluginName));
return new JsonRpcSuccessResponse(requestContext.getRequest().getId());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,10 @@ public enum JsonRpcError {
ENCLAVE_PRIVACY_GROUP_MISSING(-50200, "PrivacyGroupNotFound"),
ENCLAVE_PRIVACY_QUERY_ERROR(-50200, "PrivacyGroupQueryError"),
ENCLAVE_KEYS_CANNOT_DECRYPT_PAYLOAD(-50200, "EnclaveKeysCannotDecryptPayload"),
METHOD_UNIMPLEMENTED(-50200, "MethodUnimplemented");
METHOD_UNIMPLEMENTED(-50200, "MethodUnimplemented"),

/** Plugins error */
PLUGIN_NOT_FOUND(-60000, "Plugin not found");

private final int code;
private final String message;
Expand Down

0 comments on commit 8afd651

Please sign in to comment.