routes/index.ts: Correctly register wsErrorHandler

express requires all 4 arguments to be declared for a error handler.
It's very unfortunate that our types do not handle this.
This commit is contained in:
Anmol Sethi 2021-01-11 14:33:46 -05:00
parent 497b01bffe
commit ba4a24809c
No known key found for this signature in database
GPG Key ID: 8CEF1878FF10ADEB
1 changed files with 1 additions and 1 deletions

View File

@ -165,7 +165,7 @@ export const register = async (
app.use(errorHandler) app.use(errorHandler)
const wsErrorHandler: express.ErrorRequestHandler = async (err, req) => { const wsErrorHandler: express.ErrorRequestHandler = async (err, req, res, next) => {
logger.error(`${err.message} ${err.stack}`) logger.error(`${err.message} ${err.stack}`)
;(req as WebsocketRequest).ws.end() ;(req as WebsocketRequest).ws.end()
} }