Browse Source

use apiv3Err

Shun Miyazawa 3 years ago
parent
commit
6bafba82dc
1 changed files with 3 additions and 1 deletions
  1. 3 1
      packages/app/src/server/routes/apiv3/page.js

+ 3 - 1
packages/app/src/server/routes/apiv3/page.js

@@ -474,7 +474,9 @@ module.exports = (crowi) => {
 
     try {
       const fromPage = await Page.findByPath(fromPath);
-      if (fromPage == null) throw new Error('fromPage is Null');
+      if (fromPage == null) {
+        return res.apiv3Err(new ErrorV3('fromPage is Null'), 400);
+      }
 
       const fromPageDescendants = await Page.findManageableListWithDescendants(fromPage, req.user);