Yuki Takei 6 лет назад
Родитель
Сommit
5b66763671
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      src/server/routes/apiv3/response.js

+ 2 - 2
src/server/routes/apiv3/response.js

@@ -13,7 +13,7 @@ const addCustomFunctionToResponse = (express, crowi) => {
     this.json({ data: obj });
   };
 
-  express.response.apiv3Err = function(_err, status = 400) { // not arrow function
+  express.response.apiv3Err = function(_err, status = 400, info) { // not arrow function
     if (!Number.isInteger(status)) {
       throw new Error('invalid status supplied to res.apiv3Err');
     }
@@ -33,7 +33,7 @@ const addCustomFunctionToResponse = (express, crowi) => {
       throw new Error('invalid error supplied to res.apiv3Err');
     });
 
-    this.status(status).json({ errors });
+    this.status(status).json({ errors, info });
   };
 };