package com.hdkj.lt.base.exception;

import com.hdkj.hussar.IResultCode;

/**
 * @Description:
 * @Author: wenhao
 * @Create: 2022/08/12 17:49
 * @Version: 1.0
 */
public class BusinessException extends RuntimeException {

    private IResultCode resultCode;

    public BusinessException(String message) {
        super(message);
    }

    public BusinessException(IResultCode resultCode) {
        this.resultCode = resultCode;
    }

    public BusinessException(String message, IResultCode resultCode) {
        super(message);
        this.resultCode = resultCode;
    }

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

    public BusinessException(Throwable cause, IResultCode resultCode) {
        super(cause);
        this.resultCode = resultCode;
    }

    public BusinessException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace, IResultCode resultCode) {
        super(message, cause, enableSuppression, writableStackTrace);
        this.resultCode = resultCode;
    }

    public IResultCode getResultCode() {
        return resultCode;
    }

    public void setResultCode(IResultCode resultCode) {
        this.resultCode = resultCode;
    }

    @Override
    public String getMessage() {
        return super.getMessage();
    }

}
