Adding a try/catch to the websocket constructor.

This commit is contained in:
Dave Smith-Hayes 2024-10-23 22:04:04 -04:00
parent 4c500365fe
commit 29e442677b

View File

@ -1,3 +1,8 @@
export function createWebSocket() {
return new WebSocket("ws://localhost:3000/chat-service");
try {
return new WebSocket("ws://localhost:3000/chat-service");
} catch (e) {
console.error(e);
throw e;
}
}