public class ExceptionHandler
extends java.lang.Object
If an Exception should be raised nonetheless, we could raise a new RuntimeException.
Attention: Attacks are possible, if the location contains strings that were acquired from the outside (think terminal escape scripts).
| Modifier and Type | Field and Description |
|---|---|
protected static ExceptionHandler |
defaultHandler
the default ExceptionHandler instance
|
| Constructor and Description |
|---|
ExceptionHandler() |
| Modifier and Type | Method and Description |
|---|---|
static ExceptionHandler |
getDefaultHandler()
Return the default exception handler.
|
static void |
handle(java.lang.Throwable t,
java.lang.String location)
Handle an exception, generically.
|
void |
handleException(java.lang.Throwable t,
java.lang.String location)
Default implementation: Just print the text to System.err .
|
static void |
setDefaultHandler(ExceptionHandler handler)
Set the default exception handler.
|
protected static ExceptionHandler defaultHandler
public static void handle(java.lang.Throwable t,
java.lang.String location)
t - An Exception that should be publicized somehow, but is then ignored.location - Some description of the location where the Exception occurred. As the
method name is already stored in the backtrace, some more exact description is needed.public static void setDefaultHandler(ExceptionHandler handler)
public static ExceptionHandler getDefaultHandler()
public void handleException(java.lang.Throwable t,
java.lang.String location)
t - An Exception that should be publicized somehow, but is then ignored.location - Some description of the location where the Exception occurred. As the
method name is already stored in the backtrace, some more exact description is needed.