package com.test.bijihoudaun.common.exception;

import com.test.bijihoudaun.common.response.ResultCode;
import lombok.Getter;

/**
 * 基础业务异常类
 */
@Getter
public class BaseException extends RuntimeException {
    private final ResultCode resultCode;

    public BaseException(ResultCode resultCode) {
        super(resultCode.getMsg());
        this.resultCode = resultCode;
    }

    public BaseException(ResultCode resultCode, String message) {
        super(message);
        this.resultCode = resultCode;
    }

    public BaseException(ResultCode resultCode, Throwable cause) {
        super(resultCode.getMsg(), cause);
        this.resultCode = resultCode;
    }

    public BaseException(ResultCode resultCode, String message, Throwable cause) {
        super(message, cause);
        this.resultCode = resultCode;
    }
}
