Skip to content

Commit

Permalink
klighd: default status manager also prints stack trace on error.
Browse files Browse the repository at this point in the history
  • Loading branch information
NiklasRentzCAU committed Aug 18, 2020
1 parent 2a33650 commit 5ca065c
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

import org.eclipse.core.runtime.IStatus;

import com.google.common.base.Throwables;

public interface IKlighdStatusManager {

// status handling styles, inspired by 'org.eclipse.ui.statushandlers.StatusManager.NONE', ...
Expand Down Expand Up @@ -56,8 +58,12 @@ public void handle(IStatus status, int style) {
}

final String msg = status.getException() == null ? status.getMessage() : status.getException().getMessage();
if (msg != null && !msg.isEmpty())
if (msg != null && !msg.isEmpty()) {
System.out.println(prefix + msg);
}
if (status.getException() != null) {
System.out.println(Throwables.getStackTraceAsString(status.getException()));
}
}
}
}

0 comments on commit 5ca065c

Please sign in to comment.