Skip to content

Commit

Permalink
Merge pull request #2130 from Shohou/2120_all_exceptions
Browse files Browse the repository at this point in the history
fixes #2120 - catch all exceptions during response parsing
  • Loading branch information
gtebrean authored Dec 17, 2024
2 parents 286b63d + 2333470 commit 6785725
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline

* fixed several code issues found by sonar [#2113](https://github.com/hyperledger/web3j/pull/2113)
* update GitHub actions versions [#2114](https://github.com/hyperledger/web3j/pull/2114)
* fixed request parsing exception handling [#2120](https://github.com/hyperledger/web3j/pull/2120)
* fixed subscription object leaking after disconnect [#2121](https://github.com/hyperledger/web3j/pull/2121)

### Features
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ private void processRequestReply(String replyStr, JsonNode replyJson) throws IOE
}

sendReplyToListener(request, reply);
} catch (IllegalArgumentException e) {
} catch (Exception e) {
sendExceptionToListener(replyStr, request, e);
}
}
Expand All @@ -322,7 +322,7 @@ private void processBatchRequestReply(String replyStr, ArrayNode replyJson) thro
}

sendReplyToListener(webSocketRequests, new BatchResponse(requests, responses));
} catch (IllegalArgumentException e) {
} catch (Exception e) {
sendExceptionToListener(replyStr, webSocketRequests, e);
}
}
Expand Down Expand Up @@ -375,7 +375,7 @@ private void sendReplyToListener(WebSocketRequest request, Object reply) {
}

private void sendExceptionToListener(
String replyStr, WebSocketRequest request, IllegalArgumentException e) {
String replyStr, WebSocketRequest request, Exception e) {
request.getOnReply()
.completeExceptionally(
new IOException(
Expand Down

0 comments on commit 6785725

Please sign in to comment.