From 1967e0149cc2f3e5eaba26adf011bc7b2733e893 Mon Sep 17 00:00:00 2001 From: data Date: Wed, 10 Jul 2019 01:00:12 +0200 Subject: [PATCH] handle default errors again --- src/App.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/App.js b/src/App.js index cd05432..b3cb760 100644 --- a/src/App.js +++ b/src/App.js @@ -183,7 +183,10 @@ class App extends React.Component { return
Loading...
} renderError() { - if (this.state.error.message === 'Network Error') { + if (!this.state.error) { + return
There was an error.
+ } + else if (this.state.error.message === 'Network Error') { alert(`Failed to reach backend at\n${this.state.error.config.url}.`) } else { return (