Class MException
java.lang.Object
java.lang.Throwable
java.lang.Exception
com.motivewave.platform.sdk.common.MException
- All Implemented Interfaces:
Serializable
-
Constructor Summary
ConstructorsConstructorDescriptionMException
(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
-
MException
-
MException
-
-
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
-
getMessage
Gets the locale dependent message for this exception.- Overrides:
getMessage
in classThrowable
- Returns:
- locale dependent message
-
getMessage
-
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
-