Class AbstractException

java.lang.Object
java.lang.Throwable
java.lang.Exception
tech.xmagic.exception.AbstractException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ApiException, ApiLocalException, ApiNativeException, ApiRemoteException, ApiRpcException, ApiTimeoutException, CustomException, DataBaseException, DataException, FailureException, ForbiddenException, Http1xxException, Http2xxException, Http3xxException, Http4xxException, Http5xxException, MqException, MqTimeOutException, NotifyException, NotifyTimeOutException, SqlException, SysDeCodeException, SysDeCryptException, SysEnCodeException, SysEnCryptException, SysException, SysNotSupportException, SysParseException, SysSignException, SysVerifyException, SysWrapException, UnauthorizedException, UnKnownException, ValidationException

public abstract class AbstractException extends Exception
统一异常基类(包含异常类,业务失败类,验证类等) 基于普通异常 错误分为两级提示 msg:异常的提示信息 err:异常详细信息

message: [{code}]{msg} - err

Since:
1.0.1
Version:
1.0.1
Author:
xmagic
See Also:
  • Constructor Details

    • AbstractException

      public AbstractException(int code, String msg, String err, String tag)
      完整的异常
      Parameters:
      code - 错误代码
      msg - 错误提示
      err - 错误详情
      tag - 标签
    • AbstractException

      public AbstractException(int code, String msg, String err)
      完整的异常(无标签)
      Parameters:
      code - 错误代码
      msg - 错误提示
      err - 错误详情
    • AbstractException

      public AbstractException(int code, String msg)
      完整的异常(无错误详情,无标签)
      Parameters:
      code - 错误代码
      msg - 错误提示
    • AbstractException

      public AbstractException(ResultCode resultCode, String err, String tag)
      完整的异常
      Parameters:
      resultCode - 错误枚举
      err - 错误详情
      tag - 标签
    • AbstractException

      public AbstractException(ResultCode resultCode, String err)
      完整的异常(无标签)
      Parameters:
      resultCode - 错误枚举
      err - 错误详情
    • AbstractException

      public AbstractException(ResultCode resultCode)
      完整的异常(无错误详情,无标签)
      Parameters:
      resultCode - 错误枚举
  • Method Details

    • getCode

      public int getCode()
    • getMsg

      public String getMsg()
    • getErr

      public String getErr()
    • getTag

      public String getTag()