1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Global method for response error handling

This commit is contained in:
softworkz 2016-04-23 22:20:44 +02:00
parent b33a3302ed
commit 90e6a8e467

View file

@ -455,6 +455,22 @@ var Dashboard = {
}); });
}, },
processErrorResponse: function (response) {
Dashboard.hideLoadingMsg();
var status = '' + response.status;
if (response.statusText) {
status = response.statusText;
}
Dashboard.alert({
title: status,
message: response.headers ? response.headers.get('X-Application-Error-Code') : null
});
},
alert: function (options) { alert: function (options) {
if (typeof options == "string") { if (typeof options == "string") {