Closed npelletm closed 6 years ago
It is a best practice to reject a promise with an Error object. Bluebird promise raise a warning in this case : http://bluebirdjs.com/docs/warning-explanations.html#warning-a-promise-was-rejected-with-a-non-error because http-client promise use a HttpResponseMessage in rejection handler I add ErrorHttpResponseMessage inherits HttpResponseMessage and add name and message string attributes then bluebird considers this object as an error : https://github.com/petkaantonov/bluebird/blob/master/src/util.js#L240-L246 I also add rejectPromiseWithErrorObject: boolean; property default false to change the default behavior.
HttpResponseMessage
ErrorHttpResponseMessage
name
message
rejectPromiseWithErrorObject: boolean;
false
This PR include previous fix tests PR
This PR looks the same as the previous. Could they have accidentally contained the same commits instead of being split on test fix vs. feature?
Closed substituted with new PR #178
It is a best practice to reject a promise with an Error object. Bluebird promise raise a warning in this case : http://bluebirdjs.com/docs/warning-explanations.html#warning-a-promise-was-rejected-with-a-non-error because http-client promise use a
HttpResponseMessage
in rejection handler I addErrorHttpResponseMessage
inheritsHttpResponseMessage
and addname
andmessage
string attributes then bluebird considers this object as an error : https://github.com/petkaantonov/bluebird/blob/master/src/util.js#L240-L246 I also addrejectPromiseWithErrorObject: boolean;
property defaultfalse
to change the default behavior.This PR include previous fix tests PR