mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-13 05:07:43 +02:00
QFIX: Add promise catches (#8002)
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
@@ -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)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user