Commit a6d2edbe authored by Markus Hoelzle's avatar Markus Hoelzle Committed by Christian Kuhn
Browse files

[TASK] Install tool: Improve ajax error handling

Show an error message if the server answer ajax calls
with http status code 200. This could happen if a proxy
responses to the http request or a network failures
occures.

Releases: master
Resolves: #82388

Change-Id: Ie91832dde42c7d17323be084cfaf67cc98de8535
Reviewed-on: https://review.typo3.org/54035

Reviewed-by: Anja Leichsenring's avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring's avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
parent ee42b4a2
......@@ -49,6 +49,9 @@ define(['jquery', 'TYPO3/CMS/Install/FlashMessage', 'TYPO3/CMS/Install/ProgressB
$outputContainer.append(message);
}));
}
} else {
var message = FlashMessage.render(Severity.error, 'Something went wrong', '');
$outputContainer.empty().html(message);
}
},
error: function() {
......
......@@ -55,6 +55,9 @@ define(['jquery', 'TYPO3/CMS/Install/FlashMessage', 'TYPO3/CMS/Install/ProgressB
var message = InfoBox.render(element.severity, element.title, element.message);
$outputContainer.append(message);
});
} else {
var message = FlashMessage.render(Severity.error, 'Something went wrong', '');
$outputContainer.empty().html(message);
}
},
error: function() {
......
......@@ -89,7 +89,14 @@ define([
});
$statContainer.find(self.selectorStatLastRuler + ':last').remove();
}
} else {
var message = FlashMessage.render(Severity.error, 'Something went wrong', '');
$outputContainer.append(message);
}
},
error: function () {
var message = FlashMessage.render(Severity.error, 'Something went wrong', '');
$outputContainer.append(message);
}
});
},
......@@ -118,6 +125,9 @@ define([
var message = InfoBox.render(element.severity, element.title, element.message);
$outputContainer.append(message);
});
} else {
var message = FlashMessage.render(Severity.error, 'Something went wrong', '');
$outputContainer.append(message);
}
},
error: function () {
......
......@@ -56,6 +56,9 @@ define(['jquery', 'TYPO3/CMS/Install/FlashMessage', 'TYPO3/CMS/Install/ProgressB
var message = InfoBox.render(element.severity, element.title, element.message);
$outputContainer.html(message);
});
} else {
var message = FlashMessage.render(Severity.error, 'Something went wrong', '');
$outputContainer.empty().html(message);
}
},
error: function () {
......
......@@ -57,6 +57,9 @@ define(['jquery', 'TYPO3/CMS/Install/FlashMessage', 'TYPO3/CMS/Install/ProgressB
var message = InfoBox.render(element.severity, element.title, element.message);
$outputContainer.html(message);
});
} else {
var message = FlashMessage.render(Severity.error, 'Something went wrong', '');
$outputContainer.empty().html(message);
}
},
error: function () {
......
......@@ -112,6 +112,9 @@ define(['jquery', 'TYPO3/CMS/Install/FlashMessage', 'TYPO3/CMS/Install/ProgressB
$(self.selectorExecuteTrigger).prop('disabled', false);
$(self.selectorAnalyzeTrigger).prop('disabled', false);
}
} else {
var message = InfoBox.render(Severity.error, 'Something went wrong', '');
$outputContainer.empty().html(message);
}
},
error: function() {
......
......@@ -49,6 +49,9 @@ define(['jquery', 'TYPO3/CMS/Install/FlashMessage', 'TYPO3/CMS/Install/ProgressB
$outputContainer.append(message);
}));
}
} else {
var message = InfoBox.render(Severity.error, 'Something went wrong', '');
$outputContainer.empty().html(message);
}
},
error: function() {
......
......@@ -79,6 +79,9 @@ define([
} else if (warningCount > 0) {
$errorBadge.removeClass('label-error').addClass('label-warning').text(warningCount).show();
}
} else {
var message = FlashMessage.render(Severity.error, 'Something went wrong', '');
$outputContainer.empty().append(message);
}
},
error: function() {
......
......@@ -25,7 +25,7 @@ define(['jquery', 'TYPO3/CMS/Backend/Notification'], function($, Notification) {
initialize: function() {
var self = this;
$(document).on('click', this.selectorScanSingleTrigger, function(e) {
$(document).on('click', this.selectorScanSingleTrigger, function(e) {
// Scan a single extension
var extension = $(e.target).data('extension');
e.preventDefault();
......@@ -293,6 +293,9 @@ define(['jquery', 'TYPO3/CMS/Backend/Notification'], function($, Notification) {
} else {
Notification.warning('No files found', 'The extension EXT:' + extension + ' contains no files we can scan');
}
} else {
Notification.error('Oops, an error occurred', 'Please look at the console output for details');
console.error(data);
}
},
error: function(data) {
......
......@@ -125,6 +125,9 @@ define(['jquery',
$outputContainer.append(message);
}
self.getStatus();
} else {
var message = FlashMessage.render(Severity.error, 'Something went wrong', '');
$outputContainer.empty().html(message);
}
},
error: function() {
......
......@@ -130,6 +130,9 @@ define(['jquery', 'TYPO3/CMS/Install/FlashMessage', 'TYPO3/CMS/Install/ProgressB
var message = InfoBox.render(element.severity, element.title, element.message);
$outputContainer.append(message);
});
} else {
var message = FlashMessage.render(Severity.error, 'Something went wrong', '');
$outputContainer.empty().html(message);
}
},
error: function() {
......
......@@ -61,6 +61,9 @@ define(['jquery',
var message = InfoBox.render(element.severity, element.title, element.message);
$outputContainer.html(message);
});
} else {
var message = FlashMessage.render(Severity.error, 'Something went wrong', '');
$outputContainer.empty().html(message);
}
},
error: function () {
......
......@@ -60,6 +60,9 @@ define(['jquery', 'TYPO3/CMS/Install/FlashMessage', 'TYPO3/CMS/Install/ProgressB
var message = InfoBox.render(element.severity, element.title, element.message);
$outputContainer.append(message);
});
} else {
var message = FlashMessage.render(Severity.error, 'Something went wrong', '');
$outputContainer.empty().html(message);
}
},
error: function() {
......
......@@ -50,6 +50,9 @@ define(['jquery', 'TYPO3/CMS/Install/FlashMessage', 'TYPO3/CMS/Install/ProgressB
$outputContainer.append(message);
});
}
} else {
var message = FlashMessage.render(Severity.error, 'Something went wrong', '');
$outputContainer.empty().html(message);
}
},
error: function () {
......
......@@ -129,6 +129,9 @@ define([
$outputContainer.empty().append(message);
});
}
} else {
var message = InfoBox.render(Severity.error, 'Something went wrong', '');
$outputContainer.empty().html(message);
}
},
error: function() {
......
......@@ -65,6 +65,9 @@ define([
var message = InfoBox.render(Severity.ok, 'No TCA changes in ext_tables.php files. Good job!', '');
$outputContainer.empty().html(message);
}
} else {
var message = FlashMessage.render(Severity.error, 'Something went wrong', 'Use "Check for broken extensions"');
$outputContainer.empty().html(message);
}
},
error: function() {
......
......@@ -65,6 +65,9 @@ define([
var message = InfoBox.render(Severity.ok, 'No TCA migrations need to be applied', 'Your TCA looks good.');
$outputContainer.empty().html(message);
}
} else {
var message = FlashMessage.render(Severity.error, 'Something went wrong', 'Use "Check for broken extensions"');
$outputContainer.empty().html(message);
}
},
error: function() {
......
......@@ -117,6 +117,9 @@ function($, FlashMessage, ProgressBar, InfoBox, Severity) {
}));
}
self.blockingUpgradesDatabaseCharsetTest();
} else {
var message = FlashMessage.render(Severity.error, 'Something went wrong', '');
$outputContainer.empty().html(message);
}
},
error: function() {
......@@ -176,6 +179,10 @@ function($, FlashMessage, ProgressBar, InfoBox, Severity) {
$outputContainer.append(message);
});
}
} else {
var message = FlashMessage.render(Severity.error, 'Something went wrong', '');
self.removeLoadingMessage($outputContainer);
$outputContainer.append(message);
}
},
error: function() {
......@@ -222,6 +229,10 @@ function($, FlashMessage, ProgressBar, InfoBox, Severity) {
} else {
self.wizardsList();
}
} else {
var message = FlashMessage.render(Severity.error, 'Something went wrong', '');
self.removeLoadingMessage($outputContainer);
$outputContainer.append(message);
}
},
error: function() {
......@@ -253,6 +264,10 @@ function($, FlashMessage, ProgressBar, InfoBox, Severity) {
});
self.wizardsList();
}
} else {
var message = FlashMessage.render(Severity.error, 'Something went wrong', '');
self.removeLoadingMessage($outputContainer);
$outputContainer.append(message);
}
},
error: function() {
......@@ -308,6 +323,10 @@ function($, FlashMessage, ProgressBar, InfoBox, Severity) {
.find('span')
.text(parseInt(percent) + '%');
$outputContainer.append(list);
} else {
var message = FlashMessage.render(Severity.error, 'Something went wrong', '');
self.removeLoadingMessage($outputContainer);
$outputContainer.append(message);
}
},
error: function() {
......@@ -393,6 +412,9 @@ function($, FlashMessage, ProgressBar, InfoBox, Severity) {
self.wizardsList();
$outputDoneContainer.empty();
self.doneUpgrades();
} else {
var message = FlashMessage.render(Severity.error, 'Something went wrong', '');
$outputContainer.empty().html(message);
}
},
error: function() {
......@@ -448,6 +470,10 @@ function($, FlashMessage, ProgressBar, InfoBox, Severity) {
if (hasBodyContent === true) {
$outputContainer.append(body);
}
} else {
var message = FlashMessage.render(Severity.error, 'Something went wrong', '');
self.removeLoadingMessage($outputContainer);
$outputContainer.append(message);
}
},
error: function() {
......@@ -484,6 +510,9 @@ function($, FlashMessage, ProgressBar, InfoBox, Severity) {
self.doneUpgrades();
self.blockingUpgradesDatabaseCharsetTest();
});
} else {
var message = FlashMessage.render(Severity.error, 'Something went wrong', '');
$outputContainer.empty().html(message);
}
},
error: function() {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment