From 59dd07e1d59cb9fa5eee2d9c8c9428e0afc9a905 Mon Sep 17 00:00:00 2001 From: Will Hunt <half-shot@molrams.com> Date: Thu, 14 Sep 2017 10:04:41 +0100 Subject: [PATCH] Catch exceptions in store --- src/store.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/store.ts b/src/store.ts index 2ea8267..37ffee1 100644 --- a/src/store.ts +++ b/src/store.ts @@ -229,9 +229,12 @@ export class DiscordStore { public Get<T extends IDbData>(dbType: {new(): T; }, params: any): Promise<T> { const dType = new dbType(); - log.silly("DiscordStore", `get <${dType.constructor.name}>`); + log.silly("DiscordStore", `get <${dType.constructor.name} with params ${params}>`); return dType.RunQuery(this, params).then(() => { + log.silly("DiscordStore", `Finished query with ${dType.Result ? "Results" : "No Results"}`); return dType; + }).catch((ex) => { + log.warn("DiscordStore", `get <${dType.constructor.name} with params ${params} FAILED with exception ${ex}>`); }); } -- GitLab