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
public class ContractException extends RuntimeException
Generic Contract Tests exception. Base class for all contract tests exceptions.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ContractException()
ContractException(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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
rethrow()
Re-throw the original exception.static RuntimeException
wrap(Throwable ex)
IfException
parameter passed in is aRuntimeException
it is simply returned.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
ContractException
public ContractException()
-
ContractException
public ContractException(String message)
Sets a message for theException
.- Parameters:
message
- passed to theRuntimeException
message.
-
ContractException
public ContractException(Throwable originalException)
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
public ContractException(String message, Throwable originalException)
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 Detail
-
rethrow
public void rethrow() throws Throwable
Re-throw the original exception.
-
wrap
public static RuntimeException wrap(Throwable ex)
IfException
parameter passed in is aRuntimeException
it is simply returned. Otherwise theException
is wrapped in aContractException
and returned.- Parameters:
ex
- Exception to wrap or cast and return.- Returns:
- a
RuntimeException
that either is the specified exception or contains the specified exception.
-
-