Closed DavidRonNI closed 8 years ago
You are right, the errors should be wrapped. Do you need to give additional arguments to get the warning?
I would think it should be caught by the following test, but I don't get it:
it('should handle wrong path with promise', function (done) {
mailchimp.get({
path : '/wrong',
}).then(function (result) {
//Error
done(result)
}).catch(function (err) {
assert.equal(err.status, 404);
done()
})
})
In any case I'll update the library to wrap the errors
index.js line 472. Bluebird promises require an Error instance to be returned, instead the promise is rejected with (response.body) which is not an Error instance.
as such getting the following warning: a promise was rejected with a non-error: [object Object]
solution is probably to wrap the response.body in new Error(response.body.description) or anything that you wish to pass....