Skip to content

Commit

Permalink
test: Update JsonRpcExecutorHandler and test for timeout handling and…
Browse files Browse the repository at this point in the history
… 408 status

- Implement 408 (Request Timeout) status code on timeout in JsonRpcExecutorHandler
- Update JsonRpcExecutorHandlerTest to verify 408 status and timer cancellation
- Improve error handling and test coverage for timeout scenarios
- Apply spotless formatting changes

This change ensures that a 408 status code is returned on timeout and
that timer cancellation is properly implemented and tested, improving
error handling for the JsonRpcExecutorHandler. Spotless formatting
has been applied to maintain code style consistency.

Issue: hyperledger#5589
PR: hyperledger#7469
Signed-off-by: Ade Lucas <ade.lucas@consensys.net>
  • Loading branch information
cloudspores committed Aug 22, 2024
1 parent e8d86b5 commit dd1e294
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ private static void cancelTimer(final RoutingContext ctx) {
}
}

private static void handleErrorAndEndResponse(final RoutingContext ctx, final Object id, final RpcErrorType errorType) {
private static void handleErrorAndEndResponse(
final RoutingContext ctx, final Object id, final RpcErrorType errorType) {
if (!ctx.response().ended()) {
handleJsonRpcError(ctx, id, errorType);
}
Expand Down

0 comments on commit dd1e294

Please sign in to comment.