mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Use global response error handling
This commit is contained in:
parent
90e6a8e467
commit
80bca379ff
5 changed files with 9 additions and 38 deletions
|
@ -43,7 +43,7 @@
|
|||
|
||||
reloadItems(page);
|
||||
|
||||
}, onApiFailure);
|
||||
}, Dashboard.processErrorResponse);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@ -101,7 +101,7 @@
|
|||
|
||||
reloadItems(page);
|
||||
|
||||
}, onApiFailure);
|
||||
}, Dashboard.processErrorResponse);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@ -116,7 +116,7 @@
|
|||
renderResults(page, result);
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
}, onApiFailure);
|
||||
}, Dashboard.processErrorResponse);
|
||||
}
|
||||
|
||||
function getStatusText(item, enhance) {
|
||||
|
@ -273,26 +273,6 @@
|
|||
}
|
||||
}
|
||||
|
||||
function onApiFailure(e) {
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
|
||||
if (e.status == 0) {
|
||||
|
||||
Dashboard.alert({
|
||||
title: 'Auto-Organize',
|
||||
message: 'The operation is going to take a little longer. The view will be updated on completion.'
|
||||
});
|
||||
}
|
||||
else {
|
||||
|
||||
Dashboard.alert({
|
||||
title: Globalize.translate('AutoOrganizeError'),
|
||||
message: Globalize.translate('ErrorOrganizingFileWithErrorCode', e.headers.get('X-Application-Error-Code'))
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function getTabs() {
|
||||
return [
|
||||
{
|
||||
|
@ -317,7 +297,7 @@
|
|||
|
||||
ApiClient.clearOrganizationLog().then(function () {
|
||||
reloadItems(page);
|
||||
}, onApiFailure);
|
||||
}, Dashboard.processErrorResponse);
|
||||
});
|
||||
|
||||
}).on('pageshow', '#libraryFileOrganizerLogPage', function () {
|
||||
|
|
|
@ -96,15 +96,6 @@
|
|||
$('.divMatchInfos', page).html(html);
|
||||
}
|
||||
|
||||
function onApiFailure(e) {
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
|
||||
Dashboard.alert({
|
||||
message: Globalize.translate('DefaultErrorMessage')
|
||||
});
|
||||
}
|
||||
|
||||
function getTabs() {
|
||||
return [
|
||||
{
|
||||
|
@ -142,7 +133,7 @@
|
|||
|
||||
reloadList(page);
|
||||
|
||||
}, onApiFailure);
|
||||
}, Dashboard.processErrorResponse);
|
||||
|
||||
});
|
||||
|
||||
|
|
|
@ -103,7 +103,7 @@
|
|||
|
||||
tvOptions.CopyOriginalFile = $('#copyOrMoveFile', form).val();
|
||||
|
||||
ApiClient.updateNamedConfiguration('autoorganize', config).then(Dashboard.processServerConfigurationUpdateResult);
|
||||
ApiClient.updateNamedConfiguration('autoorganize', config).then(Dashboard.processServerConfigurationUpdateResult, Dashboard.processErrorResponse);
|
||||
});
|
||||
|
||||
return false;
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
config.WanDdns = $('#txtDdns', form).val();
|
||||
config.CertificatePath = $('#txtCertificatePath', form).val();
|
||||
|
||||
ApiClient.updateServerConfiguration(config).then(Dashboard.processServerConfigurationUpdateResult);
|
||||
ApiClient.updateServerConfiguration(config).then(Dashboard.processServerConfigurationUpdateResult, Dashboard.processErrorResponse);
|
||||
});
|
||||
|
||||
// Disable default form submission
|
||||
|
|
|
@ -869,7 +869,7 @@
|
|||
require(['toast'], function (toast) {
|
||||
toast('Settings saved.');
|
||||
});
|
||||
});
|
||||
}, Dashboard.processErrorResponse);
|
||||
|
||||
} else {
|
||||
|
||||
|
@ -882,7 +882,7 @@
|
|||
|
||||
Dashboard.navigate('dlnaprofiles.html');
|
||||
|
||||
});
|
||||
}, Dashboard.processErrorResponse);
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue