Skip to content

Commit

Permalink
Merge pull request #4546 from pabender/master
Browse files Browse the repository at this point in the history
 Suppress error message when an exception was thrown indicating we know the port was closed or closing.
  • Loading branch information
pabender committed Dec 11, 2017
2 parents 35a91e1 + 000332e commit ae74220
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion java/src/jmri/server/json/JsonWebSocket.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,11 @@ public void onMessage(String string) {
try {
this.handler.onMessage(string);
} catch (IOException e) {
log.error("Error on WebSocket message:\n{}", e.getMessage());
if(!e.getMessage().equals("Will not send message on non-open session")) {
// This exception did not occured because the connection is
// either closing or already closed, so log it.
log.error("Error on WebSocket message:\n{}", e.getMessage());
}
this.connection.getSession().close();
InstanceManager.getDefault(jmri.ShutDownManager.class).deregister(this.shutDownTask);
}
Expand Down

0 comments on commit ae74220

Please sign in to comment.