Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

Commit

Permalink
Detailed msg when log filter not found (#428)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucassaldanha committed Dec 17, 2018
1 parent 0e0aa98 commit e62d68e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
Expand Up @@ -48,6 +48,6 @@ public JsonRpcResponse response(final JsonRpcRequest request) {
return new JsonRpcSuccessResponse(request.getId(), new LogsResult(logs));
}

return new JsonRpcErrorResponse(request.getId(), JsonRpcError.FILTER_NOT_FOUND);
return new JsonRpcErrorResponse(request.getId(), JsonRpcError.LOGS_FILTER_NOT_FOUND);
}
}
Expand Up @@ -28,6 +28,7 @@ public enum JsonRpcError {

// Filter & Subscription Errors
FILTER_NOT_FOUND(-32000, "Filter not found"),
LOGS_FILTER_NOT_FOUND(-32000, "Logs filter not found"),
SUBSCRIPTION_NOT_FOUND(-32000, "Subscription not found"),
NO_MINING_WORK_FOUND(-32000, "No mining work available yet"),

Expand Down
Expand Up @@ -88,7 +88,7 @@ public void shouldReturnErrorWhenMissingFilterId() {
public void shouldReturnFilterNotFoundWhenFilterManagerReturnsNull() {
final JsonRpcRequest request = requestWithFilterId("NOT FOUND");
final JsonRpcResponse expectedResponse =
new JsonRpcErrorResponse(null, JsonRpcError.FILTER_NOT_FOUND);
new JsonRpcErrorResponse(null, JsonRpcError.LOGS_FILTER_NOT_FOUND);
when(filterManager.logs(eq("NOT FOUND"))).thenReturn(null);

final JsonRpcResponse response = method.response(request);
Expand Down

0 comments on commit e62d68e

Please sign in to comment.