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:
parent
b33a3302ed
commit
90e6a8e467
1 changed files with 16 additions and 0 deletions
|
@ -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") {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue