package com.qqchen.deploy.backend.framework.ssh.file;

import com.qqchen.deploy.backend.framework.enums.ResponseCode;
import com.qqchen.deploy.backend.framework.enums.SSHFileErrorType;
import com.qqchen.deploy.backend.framework.exception.BusinessException;

/**
 * SSH文件操作异常（Framework层）
 * 
 * 继承BusinessException，使用框架的异常体系和国际化
 */
public class SSHFileException extends BusinessException {
    
    /**
     * 异常类型（用于错误详情记录）
     */
    private final SSHFileErrorType errorType;
    
    /**
     * 原始异常
     */
    private final Throwable originalCause;
    
    public SSHFileException(SSHFileErrorType errorType, ResponseCode errorCode) {
        super(errorCode);
        this.errorType = errorType;
        this.originalCause = null;
    }
    
    public SSHFileException(SSHFileErrorType errorType, ResponseCode errorCode, Object... args) {
        super(errorCode, args);
        this.errorType = errorType;
        this.originalCause = null;
    }
    
    public SSHFileException(SSHFileErrorType errorType, ResponseCode errorCode, Throwable cause) {
        super(errorCode, cause);
        this.errorType = errorType;
        this.originalCause = cause;
    }
    
    public SSHFileErrorType getErrorType() {
        return errorType;
    }
    
    public Throwable getOriginalCause() {
        return originalCause;
    }
}
