The list of methods to do Exception Print are organized into topic(s).
void
printException(Exception e) print Exception
System.out.println("Exception caught! Exiting ..");
System.out.println("error message: " + e.getMessage());
e.printStackTrace();
void
printException(Exception e) print Exception
StackTraceElement ste = null;
int i = 0;
while (i < e.getStackTrace().length && (ste = e.getStackTrace()[i++]).getLineNumber() == -1)
;
if (ste == null) {
printError("Utilities.printException error: StackTraceElement ste is null");
return;
String className = ste.getClassName();
String methodName = ste.getMethodName();
String fileName = ste.getFileName();
int lineNumber = ste.getLineNumber();
printError(e.toString());
printError("\tat " + className + "." + methodName + "(" + fileName + ":" + lineNumber + ")");
void
printException(String prefix, Exception e) print Exception
String message = (e == null) ? null : e.getMessage();
if ((message == null) && (e != null))
message = e.getClass().getName();
System.err.println(prefix + message);
System.err.flush();
void
printException(Throwable e, StackTraceElement[] trace) print Exception
StringBuilder out = new StringBuilder("--- Exception in Async Thread ---\n");
out.append(e.getClass().getName()).append(": ").append(e.getMessage()).append('\n');
StackTraceElement[] st = e.getStackTrace();
out.append(printTrace(st));
Throwable cause = e.getCause();
while (cause != null) {
out.append(cause.getClass().getName()).append(": ").append(cause.getMessage()).append('\n');
st = cause.getStackTrace();
...
void
printExceptionInfo(Exception e) print Exception Info
System.out.println(e.getClass().getName() + " Error: ");
System.out.println(e.getMessage() + "\n" + e.getStackTrace());