首页>代码>基于SpringBoot+mybatis+Jsp的日记记录系统代码分享>/diary/src/main/java/com/rabbit/diary/bean/core/BizException.java
package com.rabbit.diary.bean.core; /** * 业务异常 * biz是business的缩写 * * @author sunting * @see ExceptionCodeEnum */ public class BizException extends RuntimeException { private ExceptionCodeEnum error; /** * 构造器,有时我们需要将第三方异常转为自定义异常抛出,但又不想丢失原来的异常信息,此时可以传入cause * * @param error * @param cause */ public BizException(ExceptionCodeEnum error, Throwable cause) { super(cause); this.error = error; } /** * 构造器,只传入错误枚举 * * @param error */ public BizException(ExceptionCodeEnum error) { this.error = error; } public ExceptionCodeEnum getError() { return error; } public void setError(ExceptionCodeEnum error) { this.error = error; } }
最近下载更多
wanglinddad LV54
3月24日
zolscy LV12
3月21日
rain112 LV30
2月6日
全栈小陈 LV4
1月21日
酷酷的轲 LV10
2023年6月29日
微信网友_6499449700175872 LV4
2023年5月31日
980363152 LV7
2023年5月15日
最代码官方 LV167
2023年5月14日
最近浏览更多
2716804680 LV9
4月20日
微信网友_6927932988952576 LV12
3月31日
zolscy LV12
3月21日
wanglinddad LV54
3月19日
sunlzh888888 LV28
3月16日
quartz LV7
3月13日
微信网友_6888487558615040 LV6
3月1日
haozhilang LV8
2月27日
lichengai LV7
2月26日
rain112 LV30
2月6日