Skip to content
Snippets Groups Projects
Commit a7ee01dd authored by al.schwinn's avatar al.schwinn
Browse files

Print Proper Stacktrace on Exception

parent a3fa2e32
No related branches found
No related tags found
No related merge requests found
......@@ -73,26 +73,15 @@ public class ConsoleHandler {
errorStream.setActivateOnWrite(activateOnWrite);
errorStream.println(message);
}
private static void printTrace(Throwable ex) {
if( ex == null)
return;
StackTraceElement[] stacktrace = ex.getStackTrace();
for(int i=1; i<stacktrace.length; i++){
errorStream.println(stacktrace[i].toString());
}
}
public static void printStackTrace(Exception ex) {
errorStream.println(ex.getLocalizedMessage());
errorStream.println("Caused by: ");
printTrace(ex.getCause());
errorStream.println("Stacktrace: ");
errorStream.println(ex.getStackTrace().toString());
errorStream.setActivateOnWrite(true);
}
/**
* Prints error message in the silecs console.
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment