Răsfoiți Sursa

BugFix: error handling

Yuki Takei 7 ani în urmă
părinte
comite
124bbd31f8
1 a modificat fișierele cu 2 adăugiri și 2 ștergeri
  1. 2 2
      lib/models/page.js

+ 2 - 2
lib/models/page.js

@@ -839,12 +839,12 @@ module.exports = function(crowi) {
       return UserGroupRelation.findByGroupIdAndUser(grantUserGroupId, userData)
       .then((relation) => {
         if (relation == null) {
-          return reject(new Error('no relations were exist for group and user.'));
+          return new Error('no relations were exist for group and user.');
         }
         return PageGroupRelation.findOrCreateRelationForPageAndGroup(page, relation.relatedGroup);
       })
       .catch((err) => {
-        return reject(new Error('No UserGroup is exists. userGroupId : ', grantUserGroupId));
+        return new Error('No UserGroup is exists. userGroupId : ', grantUserGroupId);
       });
     }
     else {