pirumpi / sftp-upload

Allow to upload the content of a folder to a remote server through SFT utilizing pure Javascript.
40 stars 21 forks source link

Throws uncatchable error if the private key is invalid #9

Closed ggutenberg closed 5 years ago

ggutenberg commented 7 years ago
/dev/app/node_modules/ssh2/lib/Connection.js:274
      throw new Error('Unable to parse given privateKey value');
      ^

Error: Unable to parse given privateKey value
    at Connection.connect (/dev/app/node_modules/ssh2/lib/Connection.js:274:13)
    at Client.sftp (/dev/app/node_modules/scp2/lib/client.js:93:7)
    at Client.mkdir (/dev/app/node_modules/scp2/lib/client.js:118:8)
    at async.waterfall.self.write.source (/dev/app/node_modules/scp2/lib/client.js:252:14)
    at fn (/dev/app/node_modules/scp2/node_modules/async/lib/async.js:582:34)
    at Immediate.<anonymous> (/dev/app/node_modules/scp2/node_modules/async/lib/async.js:498:34)
    at runCallback (timers.js:637:20)
    at tryOnImmediate (timers.js:610:5)
    at processImmediate [as _immediateCallback] (timers.js:582:5)

This occurs even if a try/catch is wrapped around the call to new Sftp(options) as it is instantiated asynchronously.