From 74a23da1b261285270b5ea2a57bf14a5c9609472 Mon Sep 17 00:00:00 2001 From: Alexis Tyler Date: Thu, 13 Jun 2019 13:02:39 +0930 Subject: [PATCH] always throw app error Signed-off-by: Alexis Tyler --- app/graphql/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/graphql/index.js b/app/graphql/index.js index 5edb80477..1493c89ac 100644 --- a/app/graphql/index.js +++ b/app/graphql/index.js @@ -141,7 +141,7 @@ module.exports = function ($injector, glob, get, graphql, graphqlDirective, merg let apiKey; if (!token) { - throw new Error('Missing apikey.'); + throw new AppError('Missing apikey.'); } if (apiManager.expired('my_servers')) { @@ -155,7 +155,7 @@ module.exports = function ($injector, glob, get, graphql, graphqlDirective, merg } if (!apiManager.isValid('my_servers', token)) { - throw new Error('Invalid apikey.'); + throw new AppError('Invalid apikey.'); } } };