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
When using WebSocketStream to open a websocket connection to a server that returns a non-2xx status code (for example 400 or 403), an error is thrown that is not catchable in a try-catch, hence terminating the Deno program.
Test program:
try{constwss=newWebSocketStream('wss://socket.b2c2.net/quotes');constconnection=awaitwss.opened;constreader=connection.readable.getReader();while(true){const{ done, value }=awaitreader.read();if(done){console.log('done');break;}console.log(value);}}catch(error){console.log('Error catched:',error);}
Run with:
deno run -A --unstable-net test.ts
The program terminates with the following error:
error: Uncaught (in promise) WebSocketError: failed to connect to WebSocket: Invalid status code 400 Bad Request
at ext:deno_websocket/02_websocketstream.js:373:19
at eventLoopTick (ext:core/01_core.js:175:7)
The text was updated successfully, but these errors were encountered:
Version: Deno 2.1.6
When using WebSocketStream to open a websocket connection to a server that returns a non-2xx status code (for example 400 or 403), an error is thrown that is not catchable in a try-catch, hence terminating the Deno program.
Test program:
Run with:
The program terminates with the following error:
The text was updated successfully, but these errors were encountered: