Promise rejection warning
amer8 opened this issue · comments
Amer Alimanović commented
eg. on successful transactionService.read() the following warning appears in the console.
(node:41972) Warning: a promise was rejected with a non-error: [object Object]
The error can be found in a few places when doing..
if (response.statusCode){
if (response.statusCode >= 200 && response.statusCode <= 299) {
resolve()
} else {
reject()
}
}
reject()
=> The last reject() is being called always. Either do return resolve/reject() or wrap the last reject() with an else.
Victor Tate commented