1
0

ImgException.java 997 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. package com.kmall.common;
  2. /**
  3. * 自定义异常
  4. *
  5. * @author Scott
  6. * @email
  7. * @date 2016年10月27日 下午10:11:27
  8. */
  9. public class ImgException extends RuntimeException {
  10. private static final long serialVersionUID = 1L;
  11. private String msg;
  12. private int code = 500;
  13. public ImgException(String msg) {
  14. super(msg);
  15. this.msg = msg;
  16. }
  17. public ImgException(String msg, Throwable e) {
  18. super(msg, e);
  19. this.msg = msg;
  20. }
  21. public ImgException(String msg, int code) {
  22. super(msg);
  23. this.msg = msg;
  24. this.code = code;
  25. }
  26. public ImgException(String msg, int code, Throwable e) {
  27. super(msg, e);
  28. this.msg = msg;
  29. this.code = code;
  30. }
  31. public String getMsg() {
  32. return msg;
  33. }
  34. public void setMsg(String msg) {
  35. this.msg = msg;
  36. }
  37. public int getCode() {
  38. return code;
  39. }
  40. public void setCode(int code) {
  41. this.code = code;
  42. }
  43. }