mirror of
https://github.com/cdr/code-server.git
synced 2026-02-10 01:16:42 +01:00
Compare commits
No commits in common. "main" and "v4.108.2" have entirely different histories.
1 changed files with 0 additions and 12 deletions
|
|
@ -28,12 +28,6 @@ export const errorHasCode = (error: any): error is ErrorWithCode => {
|
||||||
|
|
||||||
const notFoundCodes = [404, "ENOENT", "EISDIR"]
|
const notFoundCodes = [404, "ENOENT", "EISDIR"]
|
||||||
|
|
||||||
/**
|
|
||||||
* Final HTTP error handler.
|
|
||||||
*
|
|
||||||
* Note: This handler intentionally does not call `next()` even though it
|
|
||||||
* accepts it as an argument; it is expected to be mounted last.
|
|
||||||
*/
|
|
||||||
export const errorHandler: express.ErrorRequestHandler = async (err, req, res, next) => {
|
export const errorHandler: express.ErrorRequestHandler = async (err, req, res, next) => {
|
||||||
let statusCode = 500
|
let statusCode = 500
|
||||||
|
|
||||||
|
|
@ -67,12 +61,6 @@ export const errorHandler: express.ErrorRequestHandler = async (err, req, res, n
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Final WebSocket error handler.
|
|
||||||
*
|
|
||||||
* Note: This handler intentionally does not call `next()` even though it
|
|
||||||
* accepts it as an argument; it is expected to be mounted last.
|
|
||||||
*/
|
|
||||||
export const wsErrorHandler: express.ErrorRequestHandler = async (err, req, res, next) => {
|
export const wsErrorHandler: express.ErrorRequestHandler = async (err, req, res, next) => {
|
||||||
let statusCode = 500
|
let statusCode = 500
|
||||||
if (errorHasStatusCode(err)) {
|
if (errorHasStatusCode(err)) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue