wallee-payment/typescript-sdk

Promise rejection warning

Closed this issue · 1 comments

amer8 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.

vttn commented

@amer8 thank you for the heads-up. The bug is resolved in 2.0.7