From b141ef76e99332f1f42901aa20e615d711fe9604 Mon Sep 17 00:00:00 2001 From: Joabesv Date: Fri, 17 Nov 2023 02:11:22 -0300 Subject: [PATCH] better errors in case user is not finf --- app/api/facebook/func.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/api/facebook/func.js b/app/api/facebook/func.js index 4bb81b0..1b2b8e2 100644 --- a/app/api/facebook/func.js +++ b/app/api/facebook/func.js @@ -6,10 +6,7 @@ module.exports = async (context) => { const user = await app.models.users.findOne({ ra, 'oauth.emailFacebook': email }) if (!user) { - return { - error: user, - msg: 'User does not exist' - } + throw new Error('User does not exists') } return {