Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NodeJS Client] Unhandled Websocket Error Crashes Process #118

Open
del-distributed opened this issue Feb 5, 2024 · 2 comments
Open

[NodeJS Client] Unhandled Websocket Error Crashes Process #118

del-distributed opened this issue Feb 5, 2024 · 2 comments

Comments

@del-distributed
Copy link

del-distributed commented Feb 5, 2024

I'm unable to add a simple socket.on('error') handler, since the custom socket object exported by v4-client-js doesn't support it.

node:events:497
      throw er; // Unhandled 'error' event
      ^

Error: Unexpected server response: 503
    at ClientRequest.<anonymous> (/home/node_modules/@dydxprotocol/v4-client-js/node_modules/ws/lib/websocket.js:912:7)
    at ClientRequest.emit (node:events:519:28)
    at HTTPParser.parserOnIncomingClient [as onIncoming] (node:_http_client:693:27)
    at HTTPParser.parserOnHeadersComplete (node:_http_common:119:17)
    at TLSSocket.socketOnData (node:_http_client:535:22)
    at TLSSocket.emit (node:events:519:28)
    at addChunk (node:internal/streams/readable:559:12)
    at readableAddChunkPushByteMode (node:internal/streams/readable:510:3)
    at Readable.push (node:internal/streams/readable:390:5)
    at TLSWrap.onStreamRead (node:internal/stream_base_commons:190:23)
Emitted 'error' event on WebSocket instance at:
    at emitErrorAndClose (/home/node_modules/@dydxprotocol/v4-client-js/node_modules/ws/lib/websocket.js:1033:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Copy link

linear bot commented Feb 5, 2024

@samtin0x
Copy link
Contributor

samtin0x commented Aug 8, 2024

Hi @del-distributed, are you still having this issue? If so, would you mind sharing a code sample?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants