-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Unintuitive error handling #151
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
Comments
There is unfortunately a hidden assumption in At the time I didn't bother to make nodeify return undefined as I thought that nobody will try to use callback and promise at the same time as it simply doesn't make any sense. |
+1 for returning undefined |
OK, I agree that |
Bluebird is a really nice project. I especially like the error handling semantics it adopts by default.
However, when using
.nodeify
I have encountered some troubling behavior. I brought this up yesterday on IRC, and @spion thought it could be a bug. So I am raising the issue here for further discussionWhen I call
doStuff(log)
, thelog
becomes my error handler, as it is passed into.nodeify
. Bluebird considers this error to be handled in this case.doStuff2(log)
internally callsdoStuff(log)
and so I would expect that the error would be satisfied by thelog
callback, but upon attachingfinally
(orthen
) handlers, it seems to somehow revive the error fromdoStuff
, and logs a "possibly unhandled exception" stack trace to the console.I'm not sure if it's a bug, but I would like to understand why this occurs, if it is determined to be the expected behavior, so that I can avoid writing code that might cause this behavior.
The text was updated successfully, but these errors were encountered: