mirror of
https://github.com/coder/code-server.git
synced 2026-02-19 18:01:15 +08:00
fix: enhance WebSocket error handling with status code logging
This commit is contained in:
parent
7f2112c1c9
commit
b1eb2b78af
@ -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`)
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user