ApsException.java 764 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. package com.rongwei.rwapsserver.aps.util;
  2. import lombok.Data;
  3. @Data
  4. public class ApsException extends RuntimeException{
  5. /**
  6. * 异常编码
  7. */
  8. private String code;
  9. /**
  10. * 附加数据
  11. */
  12. private Object data;
  13. public ApsException(String errorMsg) {
  14. super(errorMsg);
  15. this.code= "500";
  16. }
  17. public ApsException(String code, String errorMsg) {
  18. super(errorMsg);
  19. this.code = code;
  20. }
  21. public ApsException(String code, String errorMsg, Throwable errorCourse) {
  22. super(errorMsg,errorCourse);
  23. this.code = code;
  24. }
  25. public ApsException(String code, String message, Object data) {
  26. super(message);
  27. this.code = code;
  28. this.data = data;
  29. }
  30. }