ApiException.java 704 B

1234567891011121314151617181920212223242526272829303132333435
  1. package com.pay.wxpayback.exception;
  2. import com.pay.wxpayback.api.IErrorCode;
  3. /**
  4. * @Description 自定义API异常
  5. * @Author 小乌龟
  6. * @Date 2022/11/12 14:49
  7. */
  8. public class ApiException extends RuntimeException{
  9. private IErrorCode errorCode;
  10. public ApiException(IErrorCode errorCode) {
  11. super(errorCode.getMessage());
  12. this.errorCode = errorCode;
  13. }
  14. public ApiException(String message) {
  15. super(message);
  16. }
  17. public ApiException(Throwable cause) {
  18. super(cause);
  19. }
  20. public ApiException(String message, Throwable cause) {
  21. super(message, cause);
  22. }
  23. public IErrorCode getErrorCode() {
  24. return errorCode;
  25. }
  26. }