List of utility methods to do Throwable to String
String | getStackTrace(Throwable e) Gets a stack trace for an exception. ByteArrayOutputStream traceByteArrayStream = new ByteArrayOutputStream(); PrintStream tracePrintStream = new PrintStream(traceByteArrayStream); e.printStackTrace(tracePrintStream); tracePrintStream.flush(); return traceByteArrayStream.toString(); |
String | getStackTrace(Throwable ex) Get exception stack trace. String result = ""; try { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); ex.printStackTrace(pw); pw.close(); sw.close(); result = sw.toString(); ... |
StringTokenizer | getStackTrace(Throwable ex) get Stack Trace ByteArrayOutputStream temp = new ByteArrayOutputStream(); ex.printStackTrace(new PrintStream(temp)); String stackTrace = new String(temp.toByteArray()); return new StringTokenizer(stackTrace, LINE_BREAKING); |
String | getStackTrace(Throwable ex) get Stack Trace StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw, true); pw.write("\n---------------------- EXCEPTION STACK TRACE ----------------------\n"); ex.printStackTrace(pw); if (ex.getCause() != null) { pw.write("\n---------------------- CAUSE EXCEPTION STACK TRACE ----------------------\n"); ex.getCause().printStackTrace(pw); pw.write("\n---------------------- CAUSE EXCEPTION STACK TRACE ----------------------\n"); ... |
String[] | getStackTrace(Throwable exc) Creates and array of strings containing the exception traceback information of a Throwable. Vector lines = new Vector(); StringWriter stringWriter = new StringWriter(); PrintWriter printWriter = new PrintWriter(stringWriter); exc.printStackTrace(printWriter); try { printWriter.close(); stringWriter.close(); } catch (Exception nestedExc) { ... |
String | getStackTrace(Throwable exception) get Stack Trace StringWriter sw = null; PrintWriter pw = null; try { sw = new StringWriter(); pw = new PrintWriter(sw); exception.printStackTrace(pw); return sw.toString(); } finally { ... |
String | getStackTrace(Throwable exception) Gibt den StackTrace der Exception als String zurueck. String result = null; if (exception != null) { StringWriter stringWriter = new StringWriter(); PrintWriter printWriter = new PrintWriter(stringWriter); exception.printStackTrace(printWriter); printWriter.flush(); result = stringWriter.toString(); return result; |
String | getStackTrace(Throwable pException) this method returns a String representation of an Exception's stacktrace ByteArrayOutputStream bos = new ByteArrayOutputStream(); PrintStream ps = new PrintStream(bos); pException.printStackTrace(ps); ps.flush(); return bos.toString(); |
String | getStackTrace(Throwable pThrowable_) Returns a string which contains the stack trace. StringWriter pStringWriter = new StringWriter(); PrintWriter pPrintWriter = new PrintWriter(pStringWriter); pThrowable_.printStackTrace(pPrintWriter); return pStringWriter.toString(); |
String | getStackTrace(Throwable t) Get the full stacktrace as a string Writer result = new StringWriter(); PrintWriter writer = new PrintWriter(result); t.printStackTrace(writer); try { writer.flush(); result.flush(); writer.close(); result.close(); ... |