diff options
author | Noah Loomans <noahloomans@gmail.com> | 2018-03-20 22:35:36 +0100 |
---|---|---|
committer | Noah Loomans <noahloomans@gmail.com> | 2018-03-20 22:35:36 +0100 |
commit | 72ac0866d9ddccae43de8d5a19e8a9a01b131e9f (patch) | |
tree | 641ff370e8dd066253d71af9b0c3f58562cedb9a /src/server/routes | |
parent | 29f7292f84d456a49dd8e2dcd93ab2395470aef0 (diff) |
Refactor error handling code
Diffstat (limited to 'src/server/routes')
-rw-r--r-- | src/server/routes/getSchedule.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/server/routes/getSchedule.js b/src/server/routes/getSchedule.js index f1120b7..04df28a 100644 --- a/src/server/routes/getSchedule.js +++ b/src/server/routes/getSchedule.js @@ -69,6 +69,10 @@ router.get('/:type/:value', (req, res, next) => { res.status(response.status).end(response.data); }) .catch((err) => { + if (err.response) { + // eslint-disable-next-line no-param-reassign + err.status = err.response.status; + } next(err); }); }); |