Class MException
java.lang.Object
java.lang.Throwable
java.lang.Exception
com.motivewave.platform.sdk.common.MException
- All Implemented Interfaces:
Serializable
General Exception class
- See Also:
-
Constructor Summary
ConstructorDescriptionMException
(ErrorCode error) Constructs a new MException using the given error code.MException
(ErrorCode error, Object... parameters) Constructs a new MException with the given error code and parameter substitution for the message.MException
(Exception cause, ErrorCode error) Constructs a new MException with the cause and error msg.MException
(Exception cause, ErrorCode error, Object... parameters) Constructs a new MException with the cause, using the error. -
Method Summary
Modifier and TypeMethodDescriptionGets the error code associated with this exception.Gets the locale dependent message for this exception.getMessage
(Locale locale) Gets the exception message in the given locale (if a translation is available).Object[]
Gets the exception parameters.Gets the source object that generated this exception.boolean
Compares the internal error code with the given error code and returns true if they are equal.void
Sets the source object that generated this exception.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
MException
Constructs a new MException using the given error code.- Parameters:
error
- error code for the exception
-
MException
Constructs a new MException with the given error code and parameter substitution for the message.- Parameters:
error
- the error codeparameters
- substitution parameters for the error message
-
MException
Constructs a new MException with the cause and error msg.- Parameters:
cause
- the causeerror
- error code
-
MException
Constructs a new MException with the cause, using the error. The given parameters will be substituted into the message.- Parameters:
cause
- the causeerror
- error codeparameters
- substitution parameters
-
-
Method Details
-
getErrorCode
Gets the error code associated with this exception.- Returns:
- error code for this exception
-
getSource
Gets the source object that generated this exception.- Returns:
- source of this exception
-
setSource
Sets the source object that generated this exception.- Parameters:
src
- source of this exception
-
getParameters
Gets the exception parameters.- Returns:
- exception parameters
-
getMessage
Gets the locale dependent message for this exception.- Overrides:
getMessage
in classThrowable
- Returns:
- locale dependent message
-
getMessage
Gets the exception message in the given locale (if a translation is available).- Parameters:
locale
- locale for the message- Returns:
- exception message in the given locale (if a translation is available).
-
isError
Compares the internal error code with the given error code and returns true if they are equal.- Parameters:
error
- error code- Returns:
- true if the error codes are the same, false otherwise
-