Skip to content

Commit

Permalink
[java] ensure proper error message gets logged (#12853)
Browse files Browse the repository at this point in the history
* [java] ensure proper error message gets logged

* check getCause for null instead of getMessage
  • Loading branch information
titusfortner authored Oct 5, 2023
1 parent c8e93aa commit 33c4122
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion java/src/org/openqa/selenium/remote/http/WebSocket.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,11 @@ default void onText(CharSequence data) {
}

default void onError(Throwable cause) {
LOG.log(WARNING, cause.getMessage(), cause);
String message = cause.getMessage();
if (message == null && cause.getCause() != null) {
message = cause.getCause().getMessage();
}
LOG.log(WARNING, message, cause);
}
}
}

0 comments on commit 33c4122

Please sign in to comment.