Class MessageException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.iohao.net.framework.core.exception.MessageException
- All Implemented Interfaces:
Serializable
Exception carrying an error code and message, thrown during action method processing
to signal business errors to the client.
- Author:
- 渔民小镇
- See Also:
- date:
- 2021-12-20
-
Constructor Summary
ConstructorsConstructorDescriptionMessageException(int errorCode, String message) Create with an error code and message.MessageException(ErrorInformation errorInformation) Create from anErrorInformationinstance. -
Method Summary
Modifier and TypeMethodDescriptionintGet the error information, lazily creating an internal instance if not set.Methods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
MessageException
Create with an error code and message.- Parameters:
errorCode- the error code to return to the clientmessage- the error message describing the failure
-
MessageException
Create from anErrorInformationinstance.- Parameters:
errorInformation- the error information containing code and message
-
-
Method Details
-
getErrorInformation
Get the error information, lazily creating an internal instance if not set.- Returns:
- the error information
-
getErrorCode
public int getErrorCode()
-