Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/node/routes/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,8 @@ export const wsErrorHandler: express.ErrorRequestHandler = async (err, req, res,
} else {
logger.debug(`${err.message} ${err.stack}`)
}
// Close the WebSocket connection with the appropriate HTTP status code.
// We don't call next() here because the error has been fully handled:
// the connection is closed and the error has been logged.
;(req as WebsocketRequest).ws.end(`HTTP/1.1 ${statusCode} ${err.message}\r\n\r\n`)
}