From 29b8334b060dc0c05a509d523ead4b3a30229fef Mon Sep 17 00:00:00 2001 From: vantezzen Date: Thu, 5 Sep 2019 11:22:49 +0200 Subject: Add eslint --- app/Exceptions/Handler.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'app/Exceptions') diff --git a/app/Exceptions/Handler.js b/app/Exceptions/Handler.js index efa2e0b..cb9e10b 100644 --- a/app/Exceptions/Handler.js +++ b/app/Exceptions/Handler.js @@ -1,6 +1,5 @@ -'use strict' -const BaseExceptionHandler = use('BaseExceptionHandler') +const BaseExceptionHandler = use('BaseExceptionHandler'); /** * This class handles all exceptions thrown during @@ -20,14 +19,14 @@ class ExceptionHandler extends BaseExceptionHandler { * * @return {void} */ - async handle (error, { request, response }) { + async handle(error, { response }) { if (error.name === 'ValidationException') { - return response.status(400).send('Invalid arguments') - } else if (error.name === 'InvalidSessionException') { + return response.status(400).send('Invalid arguments'); + } if (error.name === 'InvalidSessionException') { return response.status(401).redirect('/user/login'); } - response.status(error.status).send(error.message) + return response.status(error.status).send(error.message); } /** @@ -40,8 +39,9 @@ class ExceptionHandler extends BaseExceptionHandler { * * @return {void} */ - async report (error, { request }) { + async report() { + return true; } } -module.exports = ExceptionHandler +module.exports = ExceptionHandler; -- cgit v1.2.3-54-g00ecf