From 7fc23bad26c4596bc0a77e60b9f6f16b35995a8b Mon Sep 17 00:00:00 2001 From: Alex Rothberg Date: Thu, 19 Dec 2024 01:07:14 -0500 Subject: [PATCH 1/2] Update error modal to handle timedout. --- public/js/pimcore/startup.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/public/js/pimcore/startup.js b/public/js/pimcore/startup.js index c42077dd0..7f7aaea37 100644 --- a/public/js/pimcore/startup.js +++ b/public/js/pimcore/startup.js @@ -182,6 +182,8 @@ Ext.onReady(function () { Ext.Ajax.on('requestexception', function (conn, response, options) { if(response.aborted){ console.log("xhr request to " + options.url + " aborted"); + }else if(response.timedout){ + console.error("xhr request to " + options.url + " timed out"); }else{ console.error("xhr request to " + options.url + " failed"); } @@ -197,7 +199,15 @@ Ext.onReady(function () { var date = new Date(); var errorMessage = "Timestamp: " + date.toString() + "\n"; - var errorDetailMessage = "\n" + response.responseText; + var errorDetailMessage = ""; + + if (response.responseText){ + errorDetailMessage += "\n" + response.responseText; + } + + if (response.timedout){ + errorDetailMessage += "\nRequest timed out"; + } try { errorMessage += "Status: " + response.status + " | " + response.statusText + "\n"; From d76306c59d115cd0d245139d15bdb1aca3096038 Mon Sep 17 00:00:00 2001 From: Alex Rothberg Date: Thu, 19 Dec 2024 01:16:49 -0500 Subject: [PATCH 2/2] use let --- public/js/pimcore/startup.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/js/pimcore/startup.js b/public/js/pimcore/startup.js index 7f7aaea37..8a324115e 100644 --- a/public/js/pimcore/startup.js +++ b/public/js/pimcore/startup.js @@ -199,7 +199,7 @@ Ext.onReady(function () { var date = new Date(); var errorMessage = "Timestamp: " + date.toString() + "\n"; - var errorDetailMessage = ""; + let errorDetailMessage = ""; if (response.responseText){ errorDetailMessage += "\n" + response.responseText;