ApiException.java 664 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package com.xcgl.weixin.base;
  2. /**
  3. * 异常处理类
  4. *
  5. * @author rex
  6. */
  7. public class ApiException extends RuntimeException {
  8. private static final long serialVersionUID = 1L;
  9. /**
  10. * 异常码
  11. */
  12. protected int code;
  13. public ApiException() {
  14. super("系统异常");
  15. this.code = 99;
  16. }
  17. public ApiException(String message) {
  18. super(message);
  19. this.code = 99;
  20. }
  21. public ApiException(int code, String message) {
  22. super(message);
  23. this.code = code;
  24. }
  25. public int getCode() {
  26. return code;
  27. }
  28. public void setCode(int code) {
  29. this.code = code;
  30. }
  31. }