From 5c8f57a95cd2f9667d0f7635f669d1238be2766c Mon Sep 17 00:00:00 2001 From: Christian Herzog Date: Sun, 6 Oct 2019 15:26:24 +0200 Subject: [PATCH] only show message on real error --- components/wifi-manager/code.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/components/wifi-manager/code.js b/components/wifi-manager/code.js index 0f25dd5b..454010ff 100644 --- a/components/wifi-manager/code.js +++ b/components/wifi-manager/code.js @@ -656,8 +656,10 @@ function checkStatus(){ } blockAjax = false; }) - .fail(function() { - showMessage('Could not get status.json!', 'ERROR'); + .fail(function(xhr, ajaxOptions, thrownError) { + console.log(xhr.status); + console.log(thrownError); + if (thrownError != '') showMessage(thrownError, 'ERROR'); blockAjax = false; }); } @@ -701,9 +703,11 @@ function getConfig() { "" ); }) - .fail(function() { - showMessage('Could not get config.json!', 'ERROR'); - console.log("failed to fetch config!"); + .fail(function(xhr, ajaxOptions, thrownError) { + console.log(xhr.status); + console.log(thrownError); + if (thrownError != '') showMessage(thrownError, 'ERROR'); + blockAjax = false; }); }