BusinessParamCheckingException.java 875 B

1234567891011121314151617181920212223242526272829303132
  1. package com.jsh.erp.exception;
  2. import lombok.Getter;
  3. import lombok.extern.slf4j.Slf4j;
  4. import java.util.HashMap;
  5. import java.util.Map;
  6. @Slf4j
  7. @Getter
  8. public class BusinessParamCheckingException extends Exception {
  9. private static final long serialVersionUID = 1L;
  10. private int code;
  11. private Map<String, Object> data;
  12. public BusinessParamCheckingException(int code, String reason) {
  13. super(reason);
  14. Map<String, Object> objectMap = new HashMap<>();
  15. objectMap.put("message", reason);
  16. this.code = code;
  17. this.data = objectMap;
  18. }
  19. public BusinessParamCheckingException(int code, String reason, Throwable throwable) {
  20. super(reason, throwable);
  21. Map<String, Object> objectMap = new HashMap<>();
  22. objectMap.put("message", reason);
  23. this.code = code;
  24. this.data = objectMap;
  25. }
  26. }