[price-service] Handle WS error (#501)
This commit is contained in:
parent
47c9993675
commit
9cbdeb3588
|
@ -233,6 +233,10 @@ export class WebSocketAPI {
|
||||||
this.aliveClients.add(ws);
|
this.aliveClients.add(ws);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
ws.on("error", (err: Error) => {
|
||||||
|
logger.warn(`Err with client ${this.wsId.get(ws)}: ${err}`);
|
||||||
|
});
|
||||||
|
|
||||||
ws.on("close", (_code: number, _reason: Buffer) => {
|
ws.on("close", (_code: number, _reason: Buffer) => {
|
||||||
logger.info(`client ${this.wsId.get(ws)} closed the connection.`);
|
logger.info(`client ${this.wsId.get(ws)} closed the connection.`);
|
||||||
this.promClient?.addWebSocketInteraction("close", "ok");
|
this.promClient?.addWebSocketInteraction("close", "ok");
|
||||||
|
|
Loading…
Reference in New Issue