diff options
author | 2019-09-04 09:59:25 +0200 | |
---|---|---|
committer | 2019-09-04 09:59:25 +0200 | |
commit | ea03e3766efffeb5e6b9bb90f566e64bf44640f3 (patch) | |
tree | 36f52de9554a08456949cc4a7fa5b40adc84ca94 /app/Exceptions/Handler.js | |
parent | Better response when recipe creation is disabled (diff) | |
download | ferdium-server-ea03e3766efffeb5e6b9bb90f566e64bf44640f3.tar.gz ferdium-server-ea03e3766efffeb5e6b9bb90f566e64bf44640f3.tar.zst ferdium-server-ea03e3766efffeb5e6b9bb90f566e64bf44640f3.zip |
Add user dashboard
Diffstat (limited to 'app/Exceptions/Handler.js')
-rw-r--r-- | app/Exceptions/Handler.js | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/app/Exceptions/Handler.js b/app/Exceptions/Handler.js index 94d7246..efa2e0b 100644 --- a/app/Exceptions/Handler.js +++ b/app/Exceptions/Handler.js | |||
@@ -23,6 +23,8 @@ class ExceptionHandler extends BaseExceptionHandler { | |||
23 | async handle (error, { request, response }) { | 23 | async handle (error, { request, response }) { |
24 | if (error.name === 'ValidationException') { | 24 | if (error.name === 'ValidationException') { |
25 | return response.status(400).send('Invalid arguments') | 25 | return response.status(400).send('Invalid arguments') |
26 | } else if (error.name === 'InvalidSessionException') { | ||
27 | return response.status(401).redirect('/user/login'); | ||
26 | } | 28 | } |
27 | 29 | ||
28 | response.status(error.status).send(error.message) | 30 | response.status(error.status).send(error.message) |