mirror of
https://github.com/mempool/mempool.git
synced 2025-01-18 05:12:35 +01:00
Add basic websocket error handler as emergency fix for site crashing
This commit is contained in:
parent
1e39daafb3
commit
12b3ecd078
@ -29,6 +29,7 @@ class WebsocketHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.wss.on('connection', (client: WebSocket) => {
|
this.wss.on('connection', (client: WebSocket) => {
|
||||||
|
client.on('error', logger.info);
|
||||||
client.on('message', (message: string) => {
|
client.on('message', (message: string) => {
|
||||||
try {
|
try {
|
||||||
const parsedMessage: WebsocketResponse = JSON.parse(message);
|
const parsedMessage: WebsocketResponse = JSON.parse(message);
|
||||||
|
Loading…
Reference in New Issue
Block a user