From 4eabc2d65aa742e6cf55822943f04275531d0375 Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Mon, 2 Jan 2023 21:39:15 -0600 Subject: Improve error logging --- src/state/models/get-assertions-view.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/state/models/get-assertions-view.ts') diff --git a/src/state/models/get-assertions-view.ts b/src/state/models/get-assertions-view.ts index 4778ef132..bdb2c0894 100644 --- a/src/state/models/get-assertions-view.ts +++ b/src/state/models/get-assertions-view.ts @@ -80,11 +80,14 @@ export class GetAssertionsView { this.error = '' } - private _xIdle(err: string = '') { + private _xIdle(err?: any) { this.isLoading = false this.isRefreshing = false this.hasLoaded = true - this.error = err + this.error = err ? err.toString() : '' + if (err) { + this.rootStore.log.error('Failed to fetch assertions', err) + } } // loader functions @@ -99,7 +102,7 @@ export class GetAssertionsView { this._replaceAll(res) this._xIdle() } catch (e: any) { - this._xIdle(e.toString()) + this._xIdle(e) } } -- cgit 1.4.1