public class AssertionFailedException extends CJException
exceptionMessage
Constructor and Description |
---|
AssertionFailedException(java.lang.Exception ex)
Creates an AssertionFailedException for the given exception that should
never have been thrown.
|
AssertionFailedException(java.lang.String assertion)
Creates an AssertionFailedException for the reason given.
|
Modifier and Type | Method and Description |
---|---|
static AssertionFailedException |
shouldNotHappen(java.lang.Exception ex)
Convenience method.
|
static AssertionFailedException |
shouldNotHappen(java.lang.String assertion)
Create (and caller should subsequently throw) an
AssertionFailedException . |
appendMessage, getMessage, getSQLState, getVendorCode, isTransient, setSQLState, setTransient, setVendorCode
public AssertionFailedException(java.lang.Exception ex)
ex
- the exception that should never have been thrown.public AssertionFailedException(java.lang.String assertion)
assertion
- a description of the assertion that failedpublic static AssertionFailedException shouldNotHappen(java.lang.Exception ex) throws AssertionFailedException
ex
- the exception that should never have been thrown.AssertionFailedException
AssertionFailedException
- for the exception ex.public static AssertionFailedException shouldNotHappen(java.lang.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