We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7f2112c commit b1eb2b7Copy full SHA for b1eb2b7
1 file changed
src/node/routes/errors.ts
@@ -73,5 +73,8 @@ export const wsErrorHandler: express.ErrorRequestHandler = async (err, req, res,
73
} else {
74
logger.debug(`${err.message} ${err.stack}`)
75
}
76
+ // Close the WebSocket connection with the appropriate HTTP status code.
77
+ // We don't call next() here because the error has been fully handled:
78
+ // the connection is closed and the error has been logged.
79
;(req as WebsocketRequest).ws.end(`HTTP/1.1 ${statusCode} ${err.message}\r\n\r\n`)
80
0 commit comments