Просмотр исходного кода

Merge branch 'feat/4572-get-contributors-with-gc-api' into feat/4573-add-staff-credit-data

ryohi15 5 лет назад
Родитель
Сommit
14def637a3
1 измененных файлов с 7 добавлено и 2 удалено
  1. 7 2
      src/server/routes/apiv3/growi-cloud.js

+ 7 - 2
src/server/routes/apiv3/growi-cloud.js

@@ -12,8 +12,13 @@ module.exports = (crowi) => {
       return res.json({});
       return res.json({});
     }
     }
     const url = new URL('_api/staffCredit', growiCloudUri);
     const url = new URL('_api/staffCredit', growiCloudUri);
-    const gcContributorsRes = await axios.get(url.toString());
-    return res.apiv3(gcContributorsRes.data);
+    try {
+      const gcContributorsRes = await axios.get(url.toString());
+      return res.apiv3(gcContributorsRes.data);
+    }
+    catch(err) {
+      return res.apiv3Err(err, 500);
+    }
   });
   });
 
 
   return router;
   return router;