增加自定义异常处理

店铺管理接口
This commit is contained in:
张松
2025-02-12 10:16:35 +08:00
parent d1a9383d34
commit 9057f5eadb
9 changed files with 323 additions and 27 deletions

View File

@@ -0,0 +1,35 @@
package com.czg.exception;
import com.czg.resp.CzgRespCode;
import lombok.Getter;
import lombok.Setter;
/**
* 自定义异常
*
* @author admin admin@cashier.com
* @since 1.0.0
*/
@Setter
@Getter
public class ApiNotPrintException extends RuntimeException {
private static final long serialVersionUID = 1L;
private int code;
private String msg;
public ApiNotPrintException(String msg) {
super(msg);
this.code = CzgRespCode.FAILURE.getCode();
this.msg = msg;
}
public ApiNotPrintException(String msg, Throwable e) {
super(msg, e);
this.code = CzgRespCode.FAILURE.getCode();
this.msg = msg;
}
}