public class BaseException
extends java.lang.RuntimeException
It provides basic support for capture of basic core properties and subsequent enhancement with other properties, including custom properties
| Modifier | Constructor and Description |
|---|---|
|
BaseException(java.lang.String message)
See documentation for
RuntimeException.RuntimeException(String). |
|
BaseException(java.lang.String message,
java.lang.Throwable cause)
See documentation for
RuntimeException.RuntimeException(String, Throwable). |
protected |
BaseException(java.lang.Throwable referenceExceptionToChain,
java.lang.String message,
java.lang.Throwable cause)
A protected constructor (that allows referenceException to be set) to be used only by the derived types (if
necessary).
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.StackTraceElement |
getCallerFrame()
Gets the caller frame.
|
<R> R |
getExceptionDetails(java.util.function.Function<java.lang.StringBuffer,R> callback)
* Obtains the exception details dump, including all properties, for an exception.
|
java.lang.String |
getExceptionDetailsAsString()
Obtains the exception details dump, including all properties, for an exception as string.
|
java.time.Instant |
getTimeThrown()
Gets the time at which the exception was thrown.
|
void |
printExceptionDetails(java.io.PrintStream printStream)
Obtains the exception details dump, including all properties, for an exception into a print stream.
|
void |
printExceptionDetails(java.io.PrintWriter printWriter)
Obtains the exception details dump, including all properties, for an exception into a print writer.
|
void |
putProperty(java.lang.String name,
java.lang.Object value)
Appends or removes property to the exception details.
|
<E> E |
tryGetProperty(java.lang.String name)
Gets property from the exception by name.
|
java.lang.String |
tryGetPropertyAsString(java.lang.String name)
Gets property of the exception as string.
|
protected BaseException(java.lang.Throwable referenceExceptionToChain,
java.lang.String message,
java.lang.Throwable cause)
See also documentation for RuntimeException.RuntimeException(String, Throwable)
referenceExceptionToChain - Exception that is chained to this base exceptionmessage - See documentation for RuntimeException.RuntimeException(String)cause - See documentation for RuntimeException.RuntimeException(Throwable)public BaseException(java.lang.String message)
RuntimeException.RuntimeException(String).message - See documentation for RuntimeException.RuntimeException(String)public BaseException(java.lang.String message,
java.lang.Throwable cause)
RuntimeException.RuntimeException(String, Throwable).message - See documentation for RuntimeException.RuntimeException(String)cause - See documentation for RuntimeException.RuntimeException(Throwable)public java.time.Instant getTimeThrown()
public java.lang.StackTraceElement getCallerFrame()
public void putProperty(java.lang.String name,
java.lang.Object value)
name - The name of the exception property (could be one of the core properties in EhCoreProperties)
or other value. It cannot be null or empty.value - The value of the property. If value is null all properties associated with that property name will
be removed.public <E> E tryGetProperty(java.lang.String name)
E - The expected typename - The name of the exception property (could be one of the core properties in EhCoreProperties)public java.lang.String tryGetPropertyAsString(java.lang.String name)
name - The name of the exception property (could be one of the core properties in EhCoreProperties)public <R> R getExceptionDetails(java.util.function.Function<java.lang.StringBuffer,R> callback)
R - The return type of the callback (if any)callback - The callback invoked with the string bufferpublic java.lang.String getExceptionDetailsAsString()
public void printExceptionDetails(java.io.PrintWriter printWriter)
printWriter - The print writer where to store thempublic void printExceptionDetails(java.io.PrintStream printStream)
printStream - The print stream where to store them