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

public class MessageException extends RuntimeException
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 Details

    • MessageException

      public MessageException(int errorCode, String message)
      Create with an error code and message.
      Parameters:
      errorCode - the error code to return to the client
      message - the error message describing the failure
    • MessageException

      public MessageException(ErrorInformation errorInformation)
      Create from an ErrorInformation instance.
      Parameters:
      errorInformation - the error information containing code and message
  • Method Details

    • getErrorInformation

      public ErrorInformation getErrorInformation()
      Get the error information, lazily creating an internal instance if not set.
      Returns:
      the error information
    • getErrorCode

      public int getErrorCode()