spmjs / node-scp2

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

Misleading error message "... is not a Buffer" and strange path #32

Open christianor opened 9 years ago

christianor commented 9 years ago

I had the problem that on my destination i had a file that was called like a folder on the source directory. So scp failed to access (open) the handle on the destination.

I got a misleading error, it unfortunately took me a few hours to find the cause of this error: write /home/pi/work/public/scripts/app.js/app.js // if error then path.join causes this strange path transfer 1/1 data Fatal error: handle is not a Buffer

Narigo commented 9 years ago

A better error message than handle is not a Buffer would be a big plus. Just had some fun time debugging... :)

schahriar commented 8 years ago

This needs to be merged into master. Files with a chmod of 655 can be inaccessible through this module yet the SSH2 module actually returns Error("Permission denied") as the err argument but this case is never handled. A meaningful error should be thrown to the user.