-
Notifications
You must be signed in to change notification settings - Fork 298
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
poor error message #36
Comments
Good find. Thanks! Could you give me some example code so I can write a test for it? |
Don't mind. I found it. Two tests are already failing when executed with the latest version of Bluebird. I will release a fix shortly. |
What you actually observe is the aftermath of a possibly unhandled rejection. This is a bug in request-promise, however, you probably should handle those rejections. If you just use: rp(...).then(function (body) { ... }); ...you should also use a catch like this: rp(...)
.then(function (body) { ... })
.catch(function (reason) { ... }); The catch function will handle any rejection and you won't run into the bug anymore. |
I was actually getting that output even if I was using |
Oh, that is bad! Can you give me some example code so I can fix that more quickly? |
It was just: request.get(
uri: url
qs: queryString
).then((body) ->
JSON.parse(body).data
).catch((err) ->
console.error err
) ...I would give more context, but the project is a mess right now because I'm just experimenting with the facebook API, and it should be a pretty standard call. |
Unfortunately, I can't reproduce the error when catch is used. |
Hey @slang800 I just published [email protected] to npm. |
Hi @slang800 since I wasn't able to reproduce all your issues it would be awesome if you could check whether some issues still remain with the latest version. Thanks! |
Sure. I temporarily removed request-promise & just used request wrapped by when.JS, but I'll swap that out tomorrow morning & make sure it's fixed. |
Ok, I tested it out and it seems to work! thanks! |
Thank you very much! |
When an error occurs in a request, I get this printed out (directly after whatever error message I print for the error):
...which isn't very helpful.
The text was updated successfully, but these errors were encountered: