ssh2-sftp-client
Advanced tools
Comparing version 9.0.3 to 9.0.4
{ | ||
"name": "ssh2-sftp-client", | ||
"version": "9.0.3", | ||
"version": "9.0.4", | ||
"description": "ssh2 sftp client for node", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -21,3 +21,3 @@ 'use strict'; | ||
constructor(clientName) { | ||
this.version = '9.0.2'; | ||
this.version = '9.0.4'; | ||
this.client = new Client(); | ||
@@ -161,3 +161,8 @@ this.sftp = undefined; | ||
this.on('ready', doReady); | ||
this.client.connect(config); | ||
try { | ||
this.client.connect(config); | ||
} catch (err) { | ||
this.debugMsg(`getConnection: ${err.message}`); | ||
reject(err); | ||
} | ||
}).finally(() => { | ||
@@ -228,4 +233,7 @@ this.removeListener('ready', doReady); | ||
case undefined: { | ||
if (err.message.endsWith('All configured authentication methods failed')) { | ||
throw this.fmtError(err.message, 'getConnection', errorCode.badAuth); | ||
if ( | ||
err.message.endsWith('All configured authentication methods failed') || | ||
err.message.startsWith('Cannot parse privateKey') | ||
) { | ||
throw err; | ||
} | ||
@@ -243,3 +251,3 @@ retry(err); | ||
} catch (err) { | ||
await this.end(); | ||
this.end(); | ||
throw err.custom ? err : this.fmtError(err, 'connect'); | ||
@@ -246,0 +254,0 @@ } finally { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
1724
223097
1522