From 1b25408272906ceb6d3b5c1347a1e2c3fab8a48b Mon Sep 17 00:00:00 2001 From: Jori Lallo Date: Mon, 5 Jun 2017 23:54:26 -0700 Subject: [PATCH] Added error handling back --- frontend/scenes/Document/DocumentStore.js | 32 +++++++++++------------ 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/frontend/scenes/Document/DocumentStore.js b/frontend/scenes/Document/DocumentStore.js index e4d3dbe36..e8835ba6c 100644 --- a/frontend/scenes/Document/DocumentStore.js +++ b/frontend/scenes/Document/DocumentStore.js @@ -77,23 +77,23 @@ class DocumentStore { @action fetchDocument = async () => { this.isFetching = true; - // try { - const res = await client.get( - '/documents.info', - { - id: this.documentId, - }, - { cache: true } - ); - invariant(res && res.data, 'Data should be available'); - if (this.newChildDocument) { - this.parentDocument = res.data; - } else { - this.document = res.data; + try { + const res = await client.get( + '/documents.info', + { + id: this.documentId, + }, + { cache: true } + ); + invariant(res && res.data, 'Data should be available'); + if (this.newChildDocument) { + this.parentDocument = res.data; + } else { + this.document = res.data; + } + } catch (e) { + console.error('Something went wrong'); } - // } catch (e) { - // console.error('Something went wrong'); - // } this.isFetching = false; };