BusinessException.java 841 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. package com.zksy.common.exception;
  2. import lombok.Data;
  3. @Data
  4. public class BusinessException extends RuntimeException{
  5. private Object data;
  6. private Integer code;
  7. public BusinessException() {
  8. super();
  9. }
  10. public BusinessException(String message) {
  11. super(message);
  12. this.code = 500;
  13. this.data = null;
  14. }
  15. public BusinessException(String message, Throwable cause) {
  16. super(message, cause);
  17. }
  18. // public BusinessException(Throwable cause) {
  19. // super(cause);
  20. // }
  21. public BusinessException(Integer code, String message, Object data) {
  22. super(message);
  23. this.data = data;
  24. this.code = code;
  25. }
  26. public BusinessException(String message, Object data, Throwable cause) {
  27. super(message, cause);
  28. this.data = data;
  29. }
  30. }