spmjs / node-scp2

[MAINTAINER WANTED] A pure javascript scp program based on ssh2.
384 stars 96 forks source link

In case of an error the callback is called twice #66

Open mysteron opened 8 years ago

mysteron commented 8 years ago

If there's an error such as unknown host, the callback function will be called two times.

francois-travais commented 8 years ago

I got the same issue

Spaarw commented 7 years ago

Same issue for me for "download" method !

in case of error, my callback is called twice with differents errors.

the first one :

{ [Error: EISDIR: illegal operation on a directory, open 'C:\\sent\2\REC.xml']
  errno: -4068,
  code: 'EISDIR',
  syscall: 'open',
  path: 'C:\\sent\02\REC.xml' }

the second one : { [Error: Permission denied] code: 3, lang: 'en' }

This is what I'm doing :

Scp2.defaults(host);
Scp2.download(source, destination, callback);