package cn.nianxx.thhotel.platform.documentconversion.service;

import org.springframework.http.HttpStatus;

/**
 * 文件转换受控异常。HTTP 层只返回错误码和安全摘要，不暴露文件内容、临时路径或外部命令细节。
 */
public class DocumentConversionException extends RuntimeException {

    private final HttpStatus status;
    private final String errorCode;

    /**
     * 创建文件转换受控异常。
     */
    public DocumentConversionException(HttpStatus status, String errorCode, String message) {
        super(message);
        this.status = status;
        this.errorCode = errorCode;
    }

    /**
     * 创建带内部原因的文件转换受控异常。
     */
    public DocumentConversionException(HttpStatus status, String errorCode, String message, Throwable cause) {
        super(message, cause);
        this.status = status;
        this.errorCode = errorCode;
    }

    public HttpStatus getStatus() {
        return status;
    }

    public String getErrorCode() {
        return errorCode;
    }
}
