fix: 解决sftp服务器连接失败未抛出异常,导致后续获取ChannelSft出现nullPointerException

This commit is contained in:
Chen HaoYu 2023-05-17 09:50:07 +08:00
parent f6d21f112d
commit 1ff453b9cb

View File

@ -64,6 +64,8 @@ public class SftpHelper extends FtpHelper {
String message = String.format("请确认连接ftp服务器端口是否正确错误的端口: [%s] ", port); String message = String.format("请确认连接ftp服务器端口是否正确错误的端口: [%s] ", port);
LOG.error(message); LOG.error(message);
throw DataXException.asDataXException(FtpReaderErrorCode.FAIL_LOGIN, message, e); throw DataXException.asDataXException(FtpReaderErrorCode.FAIL_LOGIN, message, e);
}else{
throw DataXException.asDataXException(FtpReaderErrorCode.COMMAND_FTP_IO_EXCEPTION, "", e);
} }
}else { }else {
if("Auth fail".equals(e.getMessage())){ if("Auth fail".equals(e.getMessage())){