BusinessException.java 575 B

123456789101112131415161718192021222324252627282930
  1. package com.dataeasy.server.common.exception;
  2. /**
  3. * 业务异常
  4. *
  5. * @author tyuio
  6. */
  7. public class BusinessException extends RuntimeException {
  8. public BusinessException(String message) {
  9. super(message);
  10. }
  11. /**
  12. * 构造业务异常信息
  13. * @param message
  14. * @return
  15. */
  16. public static BusinessException fail(String message) {
  17. return new BusinessException(message);
  18. }
  19. /**
  20. * 抛出业务异常
  21. * @param message
  22. */
  23. public static void throwFail(String message) {
  24. throw fail(message);
  25. }
  26. }