1 package com.zone.weixin4j.exception;
2
3
4
5
6
7
8
9
10
11
12 public class WeixinException extends Exception {
13
14 private static final long serialVersionUID = 7148145661883468514L;
15
16 private String errorCode;
17 private String errorMsg;
18
19 public WeixinException(String errorCode, String errorMsg) {
20 this.errorCode = errorCode;
21 this.errorMsg = errorMsg;
22 }
23
24 public WeixinException(String errorMsg) {
25 this.errorCode = "-1";
26 this.errorMsg = errorMsg;
27 }
28
29 public WeixinException(Exception e) {
30 super(e);
31 }
32
33 public WeixinException(String errorMsg, Exception e) {
34 super(e);
35 this.errorMsg = errorMsg;
36 }
37
38 public String getErrorCode() {
39 return errorCode;
40 }
41
42 public String getErrorMsg() {
43 return errorMsg;
44 }
45
46 @Override
47 public String getMessage() {
48 return this.errorCode + "," + this.errorMsg;
49 }
50 }