-
Notifications
You must be signed in to change notification settings - Fork 186
error handler #274
Comments
Thanks for submitting the issue! Can you provide example code of how you're attaching the error handler to each client? |
the issue was my code
|
Thanks for the reply! Error events currently do not include the name of the exchange or client scope of the error. There is an item #104 that tracks improving error handling. That covers both this type of error (additional information about errors) as well as tracking subscription failures. Unfortunately the library doesn't support a great way to detect subscription errors. |
Including name of the exchange in error events and disconnect/reconnecting/connected events at least should be easy. |
In the example code you posted your exchange is closure scoped. You can just reference the exchange in the error handler event. ccxwsArray[exchange].on("error", err => console.error(chalk.red("error: ")+exchange+("%s"), err)); Alternative you could use a curry if you have a more complicated construct:
|
that was what I did initially
but the error is always firing with the name of the last exchange in array. |
solved. |
Nice! I think you could have also changed the
With |
I got printed to console "warn: failure response {"event":"error","message":"Channel spot/depth_l2_tbt:ETHUSDT doesn't exist","errorCode":30040}" even without error handler. Also, I didn't get any l2updates from any exchange and after less than a minute all of the get disconnected & reconnect. |
Looks like it's from okex. Some of the older clients don't emit errors and just log warnings. That needs to be fixed. |
Any ideea why I'm not receiving any data from any exchange? using
|
Possibly that market id is unique to exchanges. Make sure you use the correct id for each exchange even if it's the same base and quote pair as other exchanges. |
Seem that I can't install a error handler for each exchange, there is only one for all of them.
If I use multiple exchanges, only the last one is firing for errors from all exchanges.
So, how can I find the source of this error (exchange)?
Error:
<title>404 Not Found</title>404 Not Found
The text was updated successfully, but these errors were encountered: