View Javadoc
1   package gboat2.base.bridge.exception;
2   
3   /**
4    * 运行时异常抽象类,系统中所有的运行时异常需要继承此类。<br>
5    * 系统提供默认实现运行异常类 {@link DefaultGboatNestedException}
6    * 
7    * @author zhangxj-a
8    */
9   public abstract class GboatNestedException extends RuntimeException {
10      private static final long serialVersionUID = -6765360320533958383L;
11  
12      // 预留字段,根据此字段可以实现多语
13      private String errorCode;
14  
15      public GboatNestedException() {
16          super();
17      }
18  
19      public GboatNestedException(String message, Throwable cause) {
20          super(message, cause);
21      }
22  
23      public GboatNestedException(String message, Throwable cause,
24              String errorCode) {
25          super(message, cause);
26          this.errorCode = errorCode;
27      }
28  
29      public GboatNestedException(String message) {
30          super(message);
31      }
32  
33      public GboatNestedException(String message, String errorCode) {
34          super(message);
35          this.errorCode = errorCode;
36      }
37  
38      public GboatNestedException(Throwable cause) {
39          super(cause);
40      }
41  
42      public GboatNestedException(Throwable cause, String errorCode) {
43          super(cause);
44          this.errorCode = errorCode;
45      }
46  
47      public String getErrorCode() {
48          return errorCode;
49      }
50  
51      // 实现多语时需要复写此方法
52      public void setErrorCode(String errorCode) {
53          this.errorCode = errorCode;
54      }
55  
56  }