Skip to content

Commit

Permalink
Merge pull request real-logic#780 from real-logic/force_print_excepti…
Browse files Browse the repository at this point in the history
…on_to_System_err

[Java] Enforce stacktrace printing to `System.err`
  • Loading branch information
mjpt777 authored Dec 10, 2019
2 parents 80736ff + 2714bb2 commit 76d0d5c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions aeron-client/src/main/java/io/aeron/Aeron.java
Original file line number Diff line number Diff line change
Expand Up @@ -521,14 +521,15 @@ public static class Configuration
public static final ErrorHandler DEFAULT_ERROR_HANDLER =
(throwable) ->
{
synchronized (System.err)
final PrintStream err = System.err;
synchronized (err)
{
System.err.println(System.currentTimeMillis() + " Exception:");
throwable.printStackTrace();
err.println(System.currentTimeMillis() + " Exception:");
throwable.printStackTrace(err);
}
if (throwable instanceof DriverTimeoutException)
{
System.err.printf(
err.printf(
"%n***%n*** timeout for the Media Driver - is it currently running? exiting%n***%n");
System.exit(-1);
}
Expand Down

0 comments on commit 76d0d5c

Please sign in to comment.