Explorar o código

improve error handling

Yuki Takei %!s(int64=8) %!d(string=hai) anos
pai
achega
e86f4d3201
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      lib/routes/login-passport.js

+ 3 - 1
lib/routes/login-passport.js

@@ -105,11 +105,13 @@ module.exports = function(crowi, app) {
           });
         })
         .catch((err) => {
-          debug('findOrRegister error: ', err);
           if (err.name != null && err.name === 'DuplicatedUsernameException') {
             req.flash('isDuplicatedUsernameExceptionOccured', true);
             return next();
           }
+          else {
+            return next(err);
+          }
         });
 
     })(req, res, next);