Skip to content

Commit

Permalink
use error handling (#7045)
Browse files Browse the repository at this point in the history
Signed-off-by: Sally MacFarlane <[email protected]>
  • Loading branch information
macfarla authored May 14, 2024
1 parent 27e5a64 commit 73ab9c1
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,13 @@ public static Handler<RoutingContext> handler(
} catch (IOException e) {
final String method = executor.getRpcMethodName(ctx);
LOG.error("{} - Error streaming JSON-RPC response", method, e);
throw new RuntimeException(e);
handleJsonRpcError(ctx, null, RpcErrorType.INTERNAL_ERROR);
}
},
() -> handleJsonRpcError(ctx, null, RpcErrorType.PARSE_ERROR));
} catch (final RuntimeException e) {
final String method = ctx.get(ContextKey.REQUEST_BODY_AS_JSON_OBJECT.name());
LOG.error("Unhandled exception in JSON-RPC executor for method {}", method, e);
handleJsonRpcError(ctx, null, RpcErrorType.INTERNAL_ERROR);
}
};
Expand Down

0 comments on commit 73ab9c1

Please sign in to comment.