Skip to content

Commit

Permalink
[TH2-5073] Handle all exception types that can be trown during execution
Browse files Browse the repository at this point in the history
  • Loading branch information
Denis Plotnikov committed Sep 19, 2023
1 parent 41a5dd8 commit a3dfce9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/com/exactpro/th2/act/ActHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ public void sendRawMessage(SendRawMessageRequest request, StreamObserver<SendRaw
if (Context.current().isCancelled()) {
LOGGER.warn("'{}' request cancelled by client", actName);
sendRawMessageErrorResponse(responseObserver, "Request has been cancelled by client");
return;
}

try {
Expand All @@ -210,7 +211,7 @@ public void sendRawMessage(SendRawMessageRequest request, StreamObserver<SendRaw
responseObserver.onNext(response);
responseObserver.onCompleted();

} catch (RuntimeException | IOException e) {
} catch (Exception e) {
LOGGER.error("Failed to send a message. Message = {}", request.getRaw(), e);
sendRawMessageErrorResponse(responseObserver, "Send message failed. Error: " + e.getMessage());
} finally {
Expand Down

0 comments on commit a3dfce9

Please sign in to comment.