package com.smppw.modaq.common.exception;

import cn.hutool.core.util.StrUtil;
import com.smppw.modaq.common.enums.StatusCode;

/**
 * @author wangzaijun
 * @date 2024/10/11 14:10
 * @description 报告解析的异常
 */
public class ReportParseException extends RuntimeException {
    private final Integer code;
    private final String msg;

    public ReportParseException(StatusCode statusCode) {
        this(statusCode.getCode(), statusCode.getMsg());
    }

    public ReportParseException(Integer code, String msg) {
        super(msg);
        this.code = code;
        this.msg = msg;
    }

    public ReportParseException(StatusCode statusCode, Object... msgs) {
        this(statusCode.getCode(), StrUtil.format(statusCode.getMsg(), msgs));
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
