Skip to content

Commit

Permalink
Fix crash (#21)
Browse files Browse the repository at this point in the history
* Return failure to client when dealing with unexpected failure

* Fixed autofilled content
  • Loading branch information
StrongestNumber9 authored Apr 4, 2024
1 parent b08c602 commit 5221dd6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main/java/com/teragrep/lsh_01/RelpConversion.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,13 @@ public RelpConversion(RelpConfig relpConfig, SecurityConfig securityConfig) {
}

public boolean onNewMessage(String remoteAddress, Map<String, String> headers, String body) {
sendMessage(body, headers);
try {
sendMessage(body, headers);
}
catch (Exception e) {
LOGGER.error("Unexpected error when sending a message: <{}>", e.getMessage(), e);
return false;
}
return true;
}

Expand Down

0 comments on commit 5221dd6

Please sign in to comment.