mirror of
https://github.com/coder/code-server.git
synced 2026-05-11 14:57:26 +02:00
Compare commits
2 Commits
v4.108.2
...
6b40f077e6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6b40f077e6 | ||
|
|
e90504b8cf |
980
package-lock.json
generated
980
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -28,6 +28,12 @@ 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
|
||||||
|
|
||||||
@@ -61,6 +67,12 @@ 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)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user