FileException.java 911 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. package com.loan.system.exception;
  2. import com.loan.system.domain.enums.ExceptionEnum;
  3. import java.io.IOException;
  4. /**
  5. * @author EdwinXu
  6. * @date 2020/9/26 - 21:38
  7. * @Description
  8. */
  9. public class FileException extends IOException {
  10. private static final long serialVersionUID = 716346130825379248L;
  11. private Integer code;
  12. public FileException(Integer code, String msg){
  13. super(msg);
  14. this.code = code;
  15. }
  16. public FileException(ExceptionEnum exceptionEnum) {
  17. super(exceptionEnum.getMsg());
  18. this.code = exceptionEnum.getCode();
  19. }
  20. public Integer getCode() {
  21. return code;
  22. }
  23. public void setCode(Integer code) {
  24. this.code = code;
  25. }
  26. @Override
  27. public String toString() {
  28. return "FileException{" +
  29. "code=" + code +
  30. " msg = " + this.getMessage() +
  31. '}';
  32. }
  33. }