diff --git a/dashboard-ui/scripts/autoorganizelog.js b/dashboard-ui/scripts/autoorganizelog.js index 24906f2573..e756a7a898 100644 --- a/dashboard-ui/scripts/autoorganizelog.js +++ b/dashboard-ui/scripts/autoorganizelog.js @@ -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 () { diff --git a/dashboard-ui/scripts/autoorganizesmart.js b/dashboard-ui/scripts/autoorganizesmart.js index 363866f8b4..c9931b072e 100644 --- a/dashboard-ui/scripts/autoorganizesmart.js +++ b/dashboard-ui/scripts/autoorganizesmart.js @@ -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); }); diff --git a/dashboard-ui/scripts/autoorganizetv.js b/dashboard-ui/scripts/autoorganizetv.js index cf781c4c4e..8a85790a7c 100644 --- a/dashboard-ui/scripts/autoorganizetv.js +++ b/dashboard-ui/scripts/autoorganizetv.js @@ -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; diff --git a/dashboard-ui/scripts/dashboardhosting.js b/dashboard-ui/scripts/dashboardhosting.js index 56e3fbe501..1cfc27559c 100644 --- a/dashboard-ui/scripts/dashboardhosting.js +++ b/dashboard-ui/scripts/dashboardhosting.js @@ -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 diff --git a/dashboard-ui/scripts/dlnaprofile.js b/dashboard-ui/scripts/dlnaprofile.js index 3ff5c49f97..d7a66f3c33 100644 --- a/dashboard-ui/scripts/dlnaprofile.js +++ b/dashboard-ui/scripts/dlnaprofile.js @@ -869,7 +869,7 @@ require(['toast'], function (toast) { toast('Settings saved.'); }); - }); + }, Dashboard.processErrorResponse); } else { @@ -882,7 +882,7 @@ Dashboard.navigate('dlnaprofiles.html'); - }); + }, Dashboard.processErrorResponse); }