aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/error.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/middlewares/error.ts')
-rw-r--r--server/middlewares/error.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/server/middlewares/error.ts b/server/middlewares/error.ts
index 540edaeeb..94762e355 100644
--- a/server/middlewares/error.ts
+++ b/server/middlewares/error.ts
@@ -5,7 +5,7 @@ import { HttpStatusCode } from '@shared/models'
5 5
6function apiFailMiddleware (req: express.Request, res: express.Response, next: express.NextFunction) { 6function apiFailMiddleware (req: express.Request, res: express.Response, next: express.NextFunction) {
7 res.fail = options => { 7 res.fail = options => {
8 const { status = HttpStatusCode.BAD_REQUEST_400, message, title, type, data, instance } = options 8 const { status = HttpStatusCode.BAD_REQUEST_400, message, title, type, data, instance, tags } = options
9 9
10 const extension = new ProblemDocumentExtension({ 10 const extension = new ProblemDocumentExtension({
11 ...data, 11 ...data,
@@ -31,11 +31,11 @@ function apiFailMiddleware (req: express.Request, res: express.Response, next: e
31 detail: message, 31 detail: message,
32 32
33 type: type 33 type: type
34 ? `https://docs.joinpeertube.org/api/rest-reference.html#section/Errors/${type}` 34 ? `https://docs.joinpeertube.org/api-rest-reference.html#section/Errors/${type}`
35 : undefined 35 : undefined
36 }, extension) 36 }, extension)
37 37
38 logger.debug('Bad HTTP request.', { json }) 38 logger.debug('Bad HTTP request.', { json, tags })
39 39
40 res.json(json) 40 res.json(json)
41 } 41 }