Skip to content

Commit

Permalink
Add logging when websocket outbound error happened
Browse files Browse the repository at this point in the history
  • Loading branch information
violetagg committed Oct 3, 2019
1 parent 4a08575 commit 155ff95
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Expand Up @@ -166,6 +166,9 @@ protected void onOutboundComplete() {
@Override
protected void onOutboundError(Throwable err) {
if (channel().isActive()) {
if (log.isDebugEnabled()) {
log.debug(format(channel(), "Outbound error happened"), err);
}
sendCloseNow(new CloseWebSocketFrame(1002, "Client internal error"));
}
}
Expand Down
Expand Up @@ -156,6 +156,9 @@ protected void onOutboundComplete() {
@Override
protected void onOutboundError(Throwable err) {
if (channel().isActive()) {
if (log.isDebugEnabled()) {
log.debug(format(channel(), "Outbound error happened"), err);
}
sendCloseNow(new CloseWebSocketFrame(1002, "Server internal error"), f ->
terminate());
}
Expand Down

0 comments on commit 155ff95

Please sign in to comment.