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.