public class AssertionFailedException extends CJException
| Modifier and Type | Field and Description |
|---|---|
private static long |
serialVersionUID |
exceptionMessage| Constructor and Description |
|---|
AssertionFailedException(Exception ex)
Creates an AssertionFailedException for the given exception that should
never have been thrown.
|
AssertionFailedException(String assertion)
Creates an AssertionFailedException for the reason given.
|
| Modifier and Type | Method and Description |
|---|---|
static AssertionFailedException |
shouldNotHappen(Exception ex)
Convenience method.
|
static AssertionFailedException |
shouldNotHappen(String assertion)
Create (and caller should subsequently throw) an
AssertionFailedException. |
appendMessage, getMessage, getSQLState, getVendorCode, isTransient, setSQLState, setTransient, setVendorCodeaddSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toStringprivate static final long serialVersionUID
public AssertionFailedException(Exception ex)
ex - the exception that should never have been thrown.public AssertionFailedException(String assertion)
assertion - a description of the assertion that failedpublic static AssertionFailedException shouldNotHappen(Exception ex) throws AssertionFailedException
ex - the exception that should never have been thrown.AssertionFailedExceptionAssertionFailedException - for the exception ex.public static AssertionFailedException shouldNotHappen(String assertion) throws AssertionFailedException
AssertionFailedException.
Typical use is as follows:
if (something == null) {
throw AssertionFailedException.shouldNotHappen("Something cannot be null");
}
assertion - messageAssertionFailedException - if exception occurs