TradingView-API
TradingView-API copied to clipboard
ENOTFOUND event not being handled
Describe the bug The websocket code in Client I think somewhere isn't listening for onError event and throws up the whole app as a result.
node:events:498
throw er; // Unhandled 'error' event
^
Error: getaddrinfo ENOTFOUND data.tradingview.com
at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:71:26)
Emitted 'error' event on WebSocket instance at:
at emitErrorAndClose (/workspaces/trading/node_modules/ws/lib/websocket.js:835:13)
at ClientRequest.<anonymous> (/workspaces/trading/node_modules/ws/lib/websocket.js:697:5)
at ClientRequest.emit (node:events:520:28)
at TLSSocket.socketErrorListener (node:_http_client:442:9)
at TLSSocket.emit (node:events:520:28)
at emitErrorNT (node:internal/streams/destroy:157:8)
at emitErrorCloseNT (node:internal/streams/destroy:122:3)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
errno: -3008,
code: 'ENOTFOUND',
syscall: 'getaddrinfo',
hostname: 'data.tradingview.com'
}
To Reproduce Easiest is to create a client/chart combo with computers internet turned off.
Expected behavior I would like client.onError() to receive this error from the websocket stream so I can handle it and retry later.
Hi mans, did anyone resolve it?
Having the same issue unfortunately, any good fixes yet?
onError does not work any time For example, it doesn't even handle timeout errors
dear @Mathieu2301 please check it thank you 🙏🏻