Class ContractException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.identityconnectors.contract.exceptions.ContractException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ObjectNotFoundException
Generic Contract Tests exception. Base class for all contract tests exceptions.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionContractException(String message) Sets a message for theException.ContractException(String message, Throwable originalException) Sets the stack trace to the original exception, so this exception can masquerade as the original only be aRuntimeException.ContractException(Throwable originalException) Sets the stack trace to the original exception, so this exception can masquerade as the original only be aRuntimeException. -
Method Summary
Modifier and TypeMethodDescriptionvoidrethrow()Re-throw the original exception.static RuntimeExceptionIfExceptionparameter passed in is aRuntimeExceptionit is simply returned.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
ContractException
public ContractException() -
ContractException
Sets a message for theException.- Parameters:
message- passed to theRuntimeExceptionmessage.
-
ContractException
Sets the stack trace to the original exception, so this exception can masquerade as the original only be aRuntimeException.- Parameters:
originalException- the original exception adapted toRuntimeException.
-
ContractException
Sets the stack trace to the original exception, so this exception can masquerade as the original only be aRuntimeException.- Parameters:
message-originalException- the original exception adapted toRuntimeException.
-
-
Method Details
-
rethrow
Re-throw the original exception. -
wrap
IfExceptionparameter passed in is aRuntimeExceptionit is simply returned. Otherwise theExceptionis wrapped in aContractExceptionand returned.- Parameters:
ex- Exception to wrap or cast and return.- Returns:
- a
RuntimeExceptionthat either is the specified exception or contains the specified exception.
-