ccxt: some advice on error handling in JS
Could you add some examples to the manual that show how to detect what the cause of an exception is?
I’m seeing some errors being thrown and in the stack i see things like [Function: OrderNotFound] and [Function: RequestTimeout]. It would be nice to be able to trap these in order to respond to them appropriately. How do you do this in javascript?
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 20 (20 by maintainers)
Commits related to this issue
- liquid proper error handler fix #3988 — committed to ccxt/ccxt by kroitor 6 years ago
- liquid cancel closed order exception made optional + error handler fix #3988 — committed to ccxt/ccxt by kroitor 6 years ago
@npomfret just in case, adding these lines before the call to
editOrdermight help figure this out or shed some light on this at the very least:Ok, my system tried to edit a partially filled order just now. I had your logging in place:
What’s harder to test is editing an open order that’s partially filled. If it happens ill do my best to capture the output.
Looks good now. Using your code above with the latest ccxt code:
Here’s the verbose output of cancelling an already cancelled order