Skip to content

Commit

Permalink
Support debug mode on all console exceptions.
Browse files Browse the repository at this point in the history
Handle all console exceptions using the same printError handler, which supports `set debug true` to print exception traces.
  • Loading branch information
timw committed Sep 4, 2024
1 parent aaf84ba commit cd3928e
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3323,7 +3323,7 @@ protected float getElapsedSecs(final long start) {
return (float) (System.currentTimeMillis() - start) / 1000;
}

protected void printError(final Exception e) {
protected void printError(final Throwable e) {
if (properties.get(OConsoleProperties.DEBUG) != null
&& Boolean.parseBoolean(properties.get(OConsoleProperties.DEBUG))) {
message("\n\n!ERROR:");
Expand Down Expand Up @@ -3598,11 +3598,7 @@ public void onMessage(String text, Object... args) {

@Override
protected void onException(Throwable e) {
Throwable current = e;
while (current != null) {
err.print("\nError: " + current.toString() + "\n");
current = current.getCause();
}
printError(e);
}

@Override
Expand Down

0 comments on commit cd3928e

Please sign in to comment.