Better client side error handling

This commit is contained in:
Mark McDowall 2012-09-30 17:05:16 -07:00
parent 08d811f7c3
commit 02cf23721a
8 changed files with 12 additions and 20 deletions

View file

@ -37,10 +37,9 @@
if (this.url.indexOf("/notification/Comet") === 0 || this.url.indexOf("/Health/Index") === 0 || this.url.indexOf("/signalr") === 0)
return;
alert("Status: " + textStatus + ", Error: " + thrownError);
$.gritter.add({
title: 'Request failed',
text: this.url,
text: 'Url: ' + this.url + '<br/>Error: ' + thrownError,
image: '../../content/images/error.png',
class_name: 'gritter-fail',
time: 10000

View file

@ -46,7 +46,6 @@ $(".addExistingButton").live('click', function () {
data: jQuery.param({ path: path, seriesName: title, seriesId: seriesId, qualityProfileId: qualityId, startDate: date }),
error: function (req, status, error) {
$(button).removeAttr('disabled');
alert("Sorry! We could not add " + path + " at this time. " + error);
},
success: function() {
root.hide('highlight', 'fast');
@ -137,7 +136,6 @@ $('#saveNewSeries').live('click', function () {
data: jQuery.param({ path: path, seriesName: seriesTitle, seriesId: seriesId, qualityProfileId: qualityId, startDate: date }),
error: function (req, status, error) {
$('#saveNewSeries').removeAttr('disabled');
alert("Sorry! We could not add " + path + " at this time. " + error);
},
success: function () {
$('#saveNewSeries').removeAttr('disabled');

View file

@ -40,18 +40,11 @@ function sendToServer(id) {
type: "POST",
url: deleteQualityProfileUrl,
data: jQuery.param({ profileId: id }),
error: function (req, status, error) {
alert("Sorry! We could not delete your Profile at this time. " + error);
},
success: function (data, textStatus, jqXHR) {
if (data == "ok") {
$("#profile_" + id).remove();
removeOption(id);
}
else {
alert(data);
}
}
});
}

View file

@ -111,9 +111,6 @@ function saveSeasonIgnore(seasonNumber, ignored) {
type: "POST",
url: saveSeasonIgnoreUrl,
data: jQuery.param({ seriesId: seriesId, seasonNumber: seasonNumber, ignored: ignored }),
error: function (req, status, error) {
alert("Sorry! We could save the ignore settings for Series: " + seriesId + ", Season: " + seasonNumber + " at this time. " + error);
}
});
}
@ -122,9 +119,6 @@ function saveEpisodeIgnore(episodeId, ignored) {
type: "POST",
url: saveEpisodeIgnoreUrl,
data: jQuery.param({ episodeId: episodeId, ignored: ignored }),
error: function (req, status, error) {
alert("Sorry! We could save the ignore settings for Episode: " + episodeId + " at this time. " + error);
}
});
}