From 3156fe58e9b238625f8876ae2e82cee26c3bb253 Mon Sep 17 00:00:00 2001 From: Bsian Date: Thu, 21 Nov 2019 14:39:07 +0000 Subject: [PATCH] Error handling --- src/api/routes/Account.ts | 3 +++ src/api/routes/Root.ts | 1 + 2 files changed, 4 insertions(+) diff --git a/src/api/routes/Account.ts b/src/api/routes/Account.ts index 198bebd..8a10596 100644 --- a/src/api/routes/Account.ts +++ b/src/api/routes/Account.ts @@ -27,6 +27,7 @@ export default class Account extends Route { res.status(200).json({ code: this.constants.codes.SUCCESS, message: acc }); } catch (error) { this.handleError(error, res); + this.server.client.util.handleError(error); } }); @@ -42,6 +43,7 @@ export default class Account extends Route { } } catch (error) { this.handleError(error, res); + this.server.client.util.handleError(error); } }); @@ -51,6 +53,7 @@ export default class Account extends Route { res.status(200).json({ code: this.constants.codes.SUCCESS, message: data }); } catch (error) { this.handleError(error, res); + this.server.client.util.handleError(error); } }); } diff --git a/src/api/routes/Root.ts b/src/api/routes/Root.ts index 4832b99..a1e5766 100644 --- a/src/api/routes/Root.ts +++ b/src/api/routes/Root.ts @@ -35,6 +35,7 @@ export default class Root extends Route { res.status(200).json({ code: this.constants.codes.SUCCESS, message: response }); } catch (error) { this.handleError(error, res); + this.server.client.util.handleError(error); } }); }