Skip to content

Commit

Permalink
Adjust logging
Browse files Browse the repository at this point in the history
  • Loading branch information
marci4 committed Dec 31, 2024
1 parent 8a8bacd commit c949bdd
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -266,12 +266,28 @@ public void onClose(int code, String reason, boolean remote) {

@Override
public void onError(Exception ex) {
fail("There should not be an exception");
fail("There should not be an exception: " + ex.getMessage());
}
};
Thread finalThread = new Thread(webSocketClient);
final AssertionError[] exc = new AssertionError[1];
exc[0] = null;
Thread finalThread = new Thread(new Runnable() {
@Override
public void run() {
try {
webSocketClient.run();
}catch(AssertionError e){
exc[0] = e;
countDownLatch.countDown();
}
}

});
finalThread.start();
finalThread.join();
if (exc[0] != null) {
throw exc[0];
}
countDownLatch.await();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ public void onClose(int code, String reason, boolean remote) {

@Override
public void onError(Exception ex) {
fail("There should not be an exception");
fail("There should not be an exception: " + ex.getMessage());
}
};
final AssertionError[] exc = new AssertionError[1];
Expand All @@ -627,6 +627,7 @@ public void run() {
webSocketClient.run();
}catch(AssertionError e){
exc[0] = e;
countDownLatch.countDown();
}
}

Expand Down

0 comments on commit c949bdd

Please sign in to comment.