Skip to content
This repository has been archived by the owner on Feb 5, 2022. It is now read-only.

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

christianor
Copy link

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

…when something goes wrong. fixed path problems when file was not accessable on destination (path.join)
@christianor christianor changed the title Misleading error message "... is not a handle" and strange path Misleading error message "... is not a Buffer" and strange path Apr 5, 2015
// destination could be a directory
// it eventually can't be accessible
// to prevent getting a destination like:
// /pubic/app.js/app.js
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"public" ? :)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

of course i ment public :-D 👍

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@christianor I think @Narigo has found a typo. It is public, not pubic.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i fixed the typo

@Narigo
Copy link

Narigo commented Jun 2, 2015

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

@schahriar
Copy link

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants