⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 appexception.java

📁 自定义架构仿struts+command循环调用版
💻 JAVA
字号:
package accp.exception;


public class AppException extends Exception {
  private Exception exception;
  private int errCode;
  private String message ;

  public AppException(int errCode, String message, Exception exception) {
    //super(message,exception);
    this.message = message;
    this.errCode = errCode;
    this.exception = exception;
    return;
  }

  public AppException(String message, Exception exception) {
    this(0,message,exception);
    return;
  }

  public AppException(int errCode, Exception exception) {
    this(errCode,"",exception);
    return;
  }

  public AppException(int errCode) {
    this(errCode,"",null);
    return;
  }

  public AppException(String message) {
    this(0,message,null);
    return;
  }

  public AppException(Exception exception) {
    this(0,"",exception);
    return;
  }


  public Exception getException() {
    return exception;
  }

  public int getErrCode() {
    return errCode;
  }

  public void appandMessage(String mess) {
    message += ";"+(mess==null?"":mess);
  }

  public String getMessage() {
    return message==null?"":message;
  }

  public void setMessage(String mess) {
    this.message = mess;
  }


  public Exception getRootCause() {
    if (exception instanceof AppException) {
      return ((AppException) exception).getRootCause();
    }
    return exception == null ? this : exception;
  }

  public String toString() {
    if (exception instanceof AppException) {
      return ((AppException) exception).toString();
    }
    return exception == null ? super.toString() : exception.toString();
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -