You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'm using Bitfinex websockets, and when there is a 429 error code, it throw an exception which is impossible to catch, and my process is killed.
I wrapped all the relative bitfinex-api-node code in a huge try/catch but it still impossible...
My code
try{constcandleKey=this.formatCandleEndpoint();this.wsSocket=newWSv2({transform: true,autoReconnect: true});this.wsSocket.once('error',error=>Logger.error(`error bitfinex candle socket for: ${this.pair}${this.interval}`,error.toString(),),);this.wsSocket.once('close',()=>{Logger.log(`Bitfinex candle socket for: ${this.pair}${this.interval} closed`);},);this.wsSocket.once('open',async()=>{constsymbol=this.formatPair();this.wsSocket.onCandle({key: candleKey},candles=>{this.lastCandle=candles[0];});constsubscribeCandle=awaitasyncWrap(this.wsSocket.subscribeCandles(candleKey));if(subscribeCandle.error){Logger.error(`Unable to subscribe on Bitfinex candle socket for: ${this.pair}${this.interval}`,subscribeCandle.error.toString(),);}});constopenCandleSocket=awaitasyncWrap(this.wsSocket.open());if(openCandleSocket.error){Logger.error(`Unable to open Bitfinex candle socket for: ${this.pair}${this.interval}`,openCandleSocket.error.toString(),);}}catch(error){Logger.error(`Bitfinex candle socket on ${this.pair}${this.interval} throw an error`,error.toString(),);this.restartOnError();}
The text was updated successfully, but these errors were encountered:
here is my stack trace... same issue we have removed bitinex till the socket issue is resolved as it kills the entier stack.
`Error: Unexpected server response: 503
at ClientRequest. (/Users/lathan/Sites/ripple/xrpl-rosetta/node_modules/ws/lib/websocket.js:616:7)
at ClientRequest.emit (node:events:394:28)
at HTTPParser.parserOnIncomingClient [as onIncoming] (node:_http_client:621:27)
at HTTPParser.parserOnHeadersComplete (node:_http_common:127:17)
at TLSSocket.socketOnData (node:_http_client:487:22)
at TLSSocket.emit (node:events:394:28)
at addChunk (node:internal/streams/readable:312:12)
at readableAddChunk (node:internal/streams/readable:287:9)
at TLSSocket.Readable.push (node:internal/streams/readable:226:10)
at TLSWrap.onStreamRead (node:internal/stream_base_commons:190:23)
1006
Reconnecting: bitfinex
node:events:371
throw er; // Unhandled 'error' event
^
Error: Unexpected server response: 503
at ClientRequest. (/Users/lathan/Sites/ripple/xrpl-rosetta/node_modules/ws/lib/websocket.js:616:7)
at ClientRequest.emit (node:events:394:28)
at HTTPParser.parserOnIncomingClient [as onIncoming] (node:_http_client:621:27)
at HTTPParser.parserOnHeadersComplete (node:_http_common:127:17)
at TLSSocket.socketOnData (node:_http_client:487:22)
at TLSSocket.emit (node:events:394:28)
at addChunk (node:internal/streams/readable:312:12)
at readableAddChunk (node:internal/streams/readable:287:9)
at TLSSocket.Readable.push (node:internal/streams/readable:226:10)
at TLSWrap.onStreamRead (node:internal/stream_base_commons:190:23)
Emitted 'error' event on WebSocket instance at:
at abortHandshake (/Users/lathan/Sites/ripple/xrpl-rosetta/node_modules/ws/lib/websocket.js:743:15)
at ClientRequest. (/Users/lathan/Sites/ripple/xrpl-rosetta/node_modules/ws/lib/websocket.js:616:7)
[... lines matching original stack trace ...]
at TLSSocket.Readable.push (node:internal/streams/readable:226:10)`
Issue type
Brief description
Hi, I'm using Bitfinex websockets, and when there is a 429 error code, it throw an exception which is impossible to catch, and my process is killed.
I wrapped all the relative
bitfinex-api-node
code in a hugetry/catch
but it still impossible...My code
The text was updated successfully, but these errors were encountered: