Skip to content

Commit

Permalink
Improved logging for unexpected situation, stacktrace will be in logs…
Browse files Browse the repository at this point in the history
… in DEBUG level
  • Loading branch information
mslosarz committed Feb 25, 2017
1 parent 8d990e5 commit 9172bb8
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -17,3 +17,5 @@
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
/target

.idea/
1 change: 1 addition & 0 deletions CHANGELOG
@@ -1,4 +1,5 @@
v0.0.6:
- Improved logging for unexpected situation, stacktrace will be in logs in DEBUG level
- One member will be able to create or join to only one conversation
- Candidates will be exchanged even for broadcast conversation
- Added new method to SignalResolver (addCustomHandler) which allows you to add your custom signal
Expand Down
Expand Up @@ -44,8 +44,8 @@ public void onClose(Session session, CloseReason reason) {

@OnError
public void onError(Session session, Throwable exception) {
log.info("Occured exception for session: " + session.getId());
log.error("Endpoint exception: ", exception);
log.error("Occured exception for session: " + session.getId() + ", reason: " + exception.getMessage());
log.debug("Endpoint exception: ", exception);
server.handleError(session, exception);
}

Expand Down
Expand Up @@ -108,7 +108,7 @@ private String writeStackTraceToString(Exception e) {
e.printStackTrace(new PrintWriter(errors));
return errors.toString();
}
return e.getCause() + " - " + e.getMessage();
return e.getClass().getSimpleName() + " - " + e.getMessage();
}

}

0 comments on commit 9172bb8

Please sign in to comment.