Skip to content

Commit

Permalink
Update error modal to handle timedout. (#802)
Browse files Browse the repository at this point in the history
* Update error modal to handle timedout.

* use let
  • Loading branch information
cancan101 authored Dec 20, 2024
1 parent 5d5b24f commit 58643e5
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion public/js/pimcore/startup.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand All @@ -197,7 +199,15 @@ Ext.onReady(function () {

var date = new Date();
var errorMessage = "Timestamp: " + date.toString() + "\n";
var errorDetailMessage = "\n" + response.responseText;
let errorDetailMessage = "";

if (response.responseText){
errorDetailMessage += "\n" + response.responseText;
}

if (response.timedout){
errorDetailMessage += "\nRequest timed out";
}

try {
errorMessage += "Status: " + response.status + " | " + response.statusText + "\n";
Expand Down

0 comments on commit 58643e5

Please sign in to comment.