public final class ExceptionUtil extends Object
Maybe not always the fastest solution to call in here, but working. Also usable for seeing examples and cutting code for manual inlining.
Constructor and Description |
---|
ExceptionUtil() |
Modifier and Type | Method and Description |
---|---|
static InputStream |
captureSystemErrForDebuggingPurposesOnly()
Returns an input stream that contains what will written in this Application to
System.err . |
static InputStream |
captureSystemOutForDebuggingPurposesOnly()
Returns an input stream that contains what will written in this Application to
System.out . |
static void |
dumpThreadStack(PrintStream outprint)
Prints out the current Thread stack to the given stream.
|
static ExceptionUtil |
instance()
Returns the singleton instance of this class.
|
public static InputStream captureSystemErrForDebuggingPurposesOnly() throws IOException
System.err
.
Caution
If you do not consume the bytes to read from the result you may block the whole application. Do only use this for debugging purposes or end to end test
code!
System.err
.IOException
- if something goes wrong.public static InputStream captureSystemOutForDebuggingPurposesOnly() throws IOException
System.out
.
Caution
If you do not consume the bytes to read from the result you may block the whole application. Do only use this for debugging purposes or end to end test
code!
System.out
.IOException
- if something goes wrong.public static void dumpThreadStack(PrintStream outprint)
outprint
- the stream to print to (e.g. System.err
).Thread.getStackTrace()
public static ExceptionUtil instance()
This method is useless for now as all methods are static. It may be used in future if VM-global configuration will be put to the state of the instance.
Copyright © 2017. All rights reserved.