This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
package com.shanzhu.market.common.exception;
// 声明当前类所在的包路径(异常处理模块的基础包)
import com.shanzhu.market.common.constants.HttpStatus;
// 导入包含HTTP状态码常量的工具类
public class BusinessException extends SysException {
// 定义业务异常类,继承自系统基础异常类SysException
public BusinessException(String message, Integer code) {
// 全参数构造方法(接收自定义错误消息和数字状态码)
super(message, code);
// 调用父类构造器初始化异常基类属性
}
public BusinessException(String msg) {
// 简化构造方法(仅接收错误消息参数)
super(msg, HttpStatus.CODE_BUSINESS_ERROR);
// 调用父类构造器,使用预定义的业务异常状态码常量