From b261562ddafe9f1afd3da7557879c700270da16a Mon Sep 17 00:00:00 2001 From: Taka Date: Wed, 25 Mar 2020 03:34:04 +0000 Subject: [PATCH] Show a better error message if the Flask server is not running. --- web/src/App.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/web/src/App.js b/web/src/App.js index 27d4d7c..6261f14 100644 --- a/web/src/App.js +++ b/web/src/App.js @@ -202,7 +202,11 @@ export class App extends React.Component on_startup_ok() ; } ) .catch( err => { - this.showErrorToast(
Couldn't get the startup messages:
{err.toString()}
) ; + let errorMsg = err.toString() ; + if ( errorMsg.indexOf( "502" ) !== -1 || errorMsg.indexOf( "504" ) !== -1 ) + this.showErrorToast(
Couldn't connect to the backend Flask server.
) ; + else + this.showErrorToast(
Couldn't get the startup messages:
{errorMsg}
) ; on_startup_failure() ; } ) ; }