RRException.java 983 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /**
  2. * Copyright (c) 2016-2019 人人开源 All rights reserved.
  3. *
  4. * https://www.renren.io
  5. *
  6. * 版权所有,侵权必究!
  7. */
  8. package com.huimv.common.exception;
  9. /**
  10. * 自定义异常
  11. *
  12. * @author Mark sunlightcs@gmail.com
  13. */
  14. public class RRException extends RuntimeException {
  15. private static final long serialVersionUID = 1L;
  16. private String msg;
  17. private int code = 500;
  18. public RRException(String msg) {
  19. super(msg);
  20. this.msg = msg;
  21. }
  22. public RRException(String msg, Throwable e) {
  23. super(msg, e);
  24. this.msg = msg;
  25. }
  26. public RRException(String msg, int code) {
  27. super(msg);
  28. this.msg = msg;
  29. this.code = code;
  30. }
  31. public RRException(String msg, int code, Throwable e) {
  32. super(msg, e);
  33. this.msg = msg;
  34. this.code = code;
  35. }
  36. public String getMsg() {
  37. return msg;
  38. }
  39. public void setMsg(String msg) {
  40. this.msg = msg;
  41. }
  42. public int getCode() {
  43. return code;
  44. }
  45. public void setCode(int code) {
  46. this.code = code;
  47. }
  48. }