wallee-payment / typescript-sdk

The wallee TypeScript library wraps around the wallee API.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Promise-based functions should not throw exceptions

amer8 opened this issue · comments

https://2ality.com/2016/03/promise-rejections-vs-exceptions.html

How to reproduce:

  • Void a completed transaction
  • Transaction not in the correct state
  • Server responds with developer_error
  • .voidOnline() throws err internally, server crashes.

How to fix:

  • Instead of throwing err, the Promise function should reject(err) regardless of the err type.

Fixed in release 2.0.3