TradingView-API icon indicating copy to clipboard operation
TradingView-API copied to clipboard

ENOTFOUND event not being handled

Open gbarton opened this issue 3 years ago • 3 comments

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.

gbarton avatar Jul 18 '22 23:07 gbarton

Hi mans, did anyone resolve it?

trungnt1008 avatar Dec 04 '22 12:12 trungnt1008

Having the same issue unfortunately, any good fixes yet?

HoeGaatie1611 avatar May 01 '23 11:05 HoeGaatie1611

onError does not work any time For example, it doesn't even handle timeout errors

dear @Mathieu2301 please check it thank you 🙏🏻

kiaxseventh avatar Jun 17 '23 12:06 kiaxseventh