From f5d0d54dedcc1473d39dfdf5bb51a037718e16d2 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Mon, 2 Nov 2020 23:02:02 +1100 Subject: [PATCH] Improve modal error message --- InvenTree/InvenTree/static/script/inventree/modals.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/InvenTree/InvenTree/static/script/inventree/modals.js b/InvenTree/InvenTree/static/script/inventree/modals.js index 26eac5676b..f731a5238b 100644 --- a/InvenTree/InvenTree/static/script/inventree/modals.js +++ b/InvenTree/InvenTree/static/script/inventree/modals.js @@ -844,8 +844,13 @@ function launchModalForm(url, options = {}) { $(modal).modal('hide'); - // Permission denied! - if (xhr.status == 400) { + if (xhr.status == 0) { + // No response from the server + showAlertDialog( + "No Response", + "No response from the InvenTree server", + ); + } else if (xhr.status == 400) { showAlertDialog( "Error 400: Bad Request", "Server returned error code 400"