package com.gonghang.h5clientapp.exception;

/**
 * @Description: 自定义异常类
 * @Author: shiwn
 * @Date: 2020/1/17 11:13
 */
public final class BusinessException extends RuntimeException {

    private int code;

    public BusinessException(int exceptionCode, String message, Throwable clause) {
        super(message, clause);
        code = exceptionCode;
    }

    public BusinessException(int exceptionCode, String message) {
        super(message);

        code = exceptionCode;
    }

    public BusinessException(ErrorCode errorCode) {
        super(errorCode.getMsg());
        code = errorCode.getCode();
    }

    public final int getCode() {
        return code;
    }
}
