QFIX: Add promise catches (#8002)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev
2025-02-14 00:03:03 +07:00
committed by GitHub
parent 8d57e0aa2e
commit 5212260083
2 changed files with 12 additions and 4 deletions
+3 -1
View File
@@ -222,7 +222,9 @@ export class ClientSession implements Session {
this.useCompression
)
} else {
void handleSend(ctx, socket, { result: tx }, 1024 * 1024, this.binaryMode, this.useCompression)
void handleSend(ctx, socket, { result: tx }, 1024 * 1024, this.binaryMode, this.useCompression).catch((err) => {
ctx.error('failed to broadcast', err)
})
}
}
+9 -3
View File
@@ -217,7 +217,9 @@ class TSessionManager implements SessionManager {
this.ctx.warn('session hang, closing...', { wsId, user: s[1].session.getUser() })
// Force close workspace if only one client and it hang.
void this.close(this.ctx, s[1].socket, wsId)
void this.close(this.ctx, s[1].socket, wsId).catch((err) => {
this.ctx.error('failed to close', err)
})
continue
}
if (
@@ -579,7 +581,9 @@ class TSessionManager implements SessionManager {
function send (): void {
for (const session of sessions) {
try {
void sendResponse(ctx, session.session, session.socket, { result: tx })
void sendResponse(ctx, session.session, session.socket, { result: tx }).catch((err) => {
ctx.error('failed to send', err)
})
} catch (err: any) {
Analytics.handleError(err)
ctx.error('error during send', { error: err })
@@ -1181,7 +1185,9 @@ export function startSessionManager (
shutdown: opt.serverFactory(
sessions,
(rctx, service, ws, msg, workspace) => {
void sessions.handleRequest(rctx, service, ws, msg, workspace)
void sessions.handleRequest(rctx, service, ws, msg, workspace).catch((err) => {
ctx.error('failed to handle request', err)
})
},
ctx,
opt.pipelineFactory,