Package net.aifusion.metamodel
Class ModelException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
net.aifusion.metamodel.ModelException
- All Implemented Interfaces:
Serializable
Class to declare CIM Exceptions
- Author:
- Sharad Singhal
- See Also:
-
Constructor Summary
ConstructorDescriptionCreate a FAILED CIM ExceptionModelException
(String message) Create a FAILED CIM Exception with a given messageModelException
(String message, Throwable cause) Create a FAILED CIM Exception with a message and an underlying causeModelException
(Throwable cause) Create a FAILED CIM Exception with an underlying causeModelException
(ExceptionReason reason) Create an Exception with the given reasonModelException
(ExceptionReason reason, String message) Create an exception with a given reason, and a message stringModelException
(ExceptionReason reason, String message, Throwable cause) Create an exception with a given reason, a message, and an underlying causeModelException
(ExceptionReason reason, Throwable cause) Create an exception with a given reason and the underlying cause -
Method Summary
Modifier and TypeMethodDescriptionGet the message accompanying this exception.Get the reason provided in this exceptionGet the message from the root cause of this exception.toString()
Get the string representation that contains the ExceptionReason and message for this Exception, followed by any embedded exceptions (and their messages)Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
-
Constructor Details
-
ModelException
public ModelException()Create a FAILED CIM Exception -
ModelException
Create a FAILED CIM Exception with a given message- Parameters:
message
- - message for the exception
-
ModelException
Create a FAILED CIM Exception with an underlying cause- Parameters:
cause
- - throwable item that caused this exception
-
ModelException
Create a FAILED CIM Exception with a message and an underlying cause- Parameters:
message
- - message for the exceptioncause
- - underlying cause of the exception
-
ModelException
Create an Exception with the given reason- Parameters:
reason
- - reason for the exception
-
ModelException
Create an exception with a given reason, and a message string- Parameters:
reason
- - reason for the exceptionmessage
- - accompanying message
-
ModelException
Create an exception with a given reason and the underlying cause- Parameters:
reason
- - reason for the exceptioncause
- - underlying cause
-
ModelException
Create an exception with a given reason, a message, and an underlying cause- Parameters:
reason
- - reason for the exceptionmessage
- - accompanying messagecause
- - underlying cause
-
-
Method Details
-
getReason
Get the reason provided in this exception- Returns:
- - reason for this exception
-
getMessage
Get the message accompanying this exception. If no message is provided, and an underlying cause is defined, the message from the cause is returned. If no underlying cause is defined, then the description from the corresponding ExceptionReason is returned.- Overrides:
getMessage
in classThrowable
-
getRootMessage
Get the message from the root cause of this exception. If this ModelException wraps a number of underlying Exception, get the message from the deepest nested exception that provides a message- Returns:
- - the message from the root cause of this exception.
-
toString
Get the string representation that contains the ExceptionReason and message for this Exception, followed by any embedded exceptions (and their messages)
-