DefenceException.java 881 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. package com.usky.common.exception;
  2. public class DefenceException extends RuntimeException {
  3. private String msg;
  4. private int code = 500;
  5. public DefenceException(String msg) {
  6. super(msg);
  7. this.msg = msg;
  8. }
  9. public DefenceException(String msg, Throwable e) {
  10. super(msg, e);
  11. this.msg = msg;
  12. }
  13. public DefenceException(String msg, int code) {
  14. super(msg);
  15. this.msg = msg;
  16. this.code = code;
  17. }
  18. public DefenceException(String msg, int code, Throwable e) {
  19. super(msg, e);
  20. this.msg = msg;
  21. this.code = code;
  22. }
  23. public String getMsg() {
  24. return this.msg;
  25. }
  26. public void setMsg(String msg) {
  27. this.msg = msg;
  28. }
  29. public int getCode() {
  30. return this.code;
  31. }
  32. public void setCode(int code) {
  33. this.code = code;
  34. }
  35. }