-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Calling a callback with an error that is an array is unexpected #52
Comments
Strange, I received an email response to this, but it's not showing here.
Yeah that's super strange. It should definitely always return either one or the other. My recollection was that the code would always return an array of errors, but I don't have it in front of me now. |
Yep, because I've noticed that it's not related to that library. |
I've been seeing effects of this for months, and i had no idea what was going on. Since I was ignoring errors anyway, I didn't spend the time to look into it, but from time to time I added some extra info to my script to help me look into it whenever it popped up again. I finally figured out this was coming from Also, if you pass one in, there is absolutely no reason to call the error stream with an array of errors. Please fix the interface so that only single errors are passed to the callback and error stream. Or if you're too lazy, please make it super clear in the docs that this is how things work. |
+1 @fresheneesz . Actually, on Heroku, I am getting single objects and on Mac, I receive an array. My simple fix is to basically do |
Three years ago, that array thing seemed like a great idea. It's definitely not worth the trouble, though, so I'm going to drop it. I plan to review a bunch of PRs today, with an eye on releasing a |
Thanks @AvianFlu, I am developing a library where your package is quite important dependency. I'd love to see a fixed version, have you got an idea why I may receive different errors depending on OS I am? I suppose it's due to different OS implementations of filesystem operations. If you need any help - you can count me in (especially in terms of bugs) |
Thanks Avian! |
This one is bit old :D but I'm using version |
I've just spent several hours debugging an issue which just provided an error message of
undefined
. I've ultimately tracked it down to an error originating from ncp calling the callback with anerr
that is an array. Unfortunately this error is then propagated to far away, to code which expects errors to beError
objects.May I suggest that a better way to handle this would be an
Error
object with an array ofpaths
in it?The text was updated successfully, but these errors were encountered: