Adding a try/catch to the websocket constructor.
This commit is contained in:
parent
4c500365fe
commit
29e442677b
@ -1,3 +1,8 @@
|
|||||||
export function createWebSocket() {
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user