mscdex / node-ftp

An FTP client module for node.js
MIT License
1.13k stars 244 forks source link

Error not catched #187

Closed scriptPilot closed 7 years ago

scriptPilot commented 7 years ago

First of all, thanks for the great piece of code!

I would like to know if there is any reason why an error (due to wrong FTP data) is not catched but shown in the console.

The code I use:

try {
  let client = new FTP()
  client.on('ready', function () {
    // do sth
  })
  client.connect(config)
} catch (err) {
  // show alert ...
}

Is there any way to test the connection without thrown error?