Class ModelException

All Implemented Interfaces:
Serializable

public class ModelException extends RuntimeException
Class to declare CIM Exceptions
Author:
Sharad Singhal
See Also:
  • Constructor Details

    • ModelException

      public ModelException()
      Create a FAILED CIM Exception
    • ModelException

      public ModelException(String message)
      Create a FAILED CIM Exception with a given message
      Parameters:
      message - - message for the exception
    • ModelException

      public ModelException(Throwable cause)
      Create a FAILED CIM Exception with an underlying cause
      Parameters:
      cause - - throwable item that caused this exception
    • ModelException

      public ModelException(String message, Throwable cause)
      Create a FAILED CIM Exception with a message and an underlying cause
      Parameters:
      message - - message for the exception
      cause - - underlying cause of the exception
    • ModelException

      public ModelException(ExceptionReason reason)
      Create an Exception with the given reason
      Parameters:
      reason - - reason for the exception
    • ModelException

      public ModelException(ExceptionReason reason, String message)
      Create an exception with a given reason, and a message string
      Parameters:
      reason - - reason for the exception
      message - - accompanying message
    • ModelException

      public ModelException(ExceptionReason reason, Throwable cause)
      Create an exception with a given reason and the underlying cause
      Parameters:
      reason - - reason for the exception
      cause - - underlying cause
    • ModelException

      public ModelException(ExceptionReason reason, String message, Throwable cause)
      Create an exception with a given reason, a message, and an underlying cause
      Parameters:
      reason - - reason for the exception
      message - - accompanying message
      cause - - underlying cause
  • Method Details

    • getReason

      public ExceptionReason getReason()
      Get the reason provided in this exception
      Returns:
      - reason for this exception
    • getMessage

      public String 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 class Throwable
    • getRootMessage

      public String 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

      public String toString()
      Get the string representation that contains the ExceptionReason and message for this Exception, followed by any embedded exceptions (and their messages)
      Overrides:
      toString in class Throwable
      Returns:
      a String representation of the exception