pull-requests: switched alert to sweet alerts.

This commit is contained in:
Marcin Kuzminski 2020-04-28 10:32:20 +02:00
parent 6e32a23add
commit a4f18c798c

View file

@ -260,9 +260,10 @@
self.cachedDataSource[cacheKey] = data; self.cachedDataSource[cacheKey] = data;
query.callback({results: data.results}); query.callback({results: data.results});
}, },
error: function(data, textStatus, errorThrown) { error: function(jqXHR, textStatus, errorThrown) {
alert( var prefix = "Error while fetching entries.\n"
"Error while fetching entries.\nError code {0} ({1}).".format(data.status, data.statusText)); var message = formatErrorMessage(jqXHR, textStatus, errorThrown, prefix);
ajaxErrorSwal(message);
} }
}); });
} }
@ -312,11 +313,11 @@
} }
loadRepoRefDiffPreview._currentRequest = $.get(url) loadRepoRefDiffPreview._currentRequest = $.get(url)
.error(function(data, textStatus, errorThrown) { .error(function(jqXHR, textStatus, errorThrown) {
if (textStatus !== 'abort') { if (textStatus !== 'abort') {
alert( var prefix = "Error while processing request.\n"
"Error while processing request.\nError code {0} ({1}).".format( var message = formatErrorMessage(jqXHR, textStatus, errorThrown, prefix);
data.status, data.statusText)); ajaxErrorSwal(message);
} }
}) })
@ -503,8 +504,10 @@
targetRepoChanged(data); targetRepoChanged(data);
loadRepoRefDiffPreview(); loadRepoRefDiffPreview();
}, },
error: function(data, textStatus, errorThrown) { error: function(jqXHR, textStatus, errorThrown) {
alert("Error while fetching entries.\nError code {0} ({1}).".format(data.status, data.statusText)); var prefix = "Error while fetching entries.\n"
var message = formatErrorMessage(jqXHR, textStatus, errorThrown, prefix);
ajaxErrorSwal(message);
} }
}) })