diff options
author | Joas Schilling <coding@schilljs.com> | 2016-09-22 17:56:57 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-22 17:56:57 +0300 |
commit | dadad12e572d78f45802f3891e68f017b960af34 (patch) | |
tree | db5617688440860166cff4a5bcdece063a17d96c | |
parent | 638dcf26e693adc0b5f639982d6d59bece32fa28 (diff) | |
parent | d023b67b82cc16cf6e1f7287fada169e9a15103d (diff) |
Merge pull request #24 from nextcloud/backport-23-graceful-dying-is-the-new-livingv10.0.6RC1v10.0.6v10.0.5RC2v10.0.5RC1v10.0.5v10.0.4RC1v10.0.4v10.0.3RC1v10.0.3v10.0.2stable10
Rest in peaceful silence after a 404 and a 503
-rw-r--r-- | js/app.js | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -81,7 +81,7 @@ $.ajax({ url: OC.linkToOCS('apps/notifications/api/v1', 2) + 'notifications/' + id + '?format=json', type: 'DELETE', - success: function(data) { + success: function() { self._removeNotification(id); }, error: function() { @@ -206,12 +206,16 @@ * @param {XMLHttpRequest} xhr */ _onFetchError: function(xhr) { - if (xhr.status === 404) { - // 404 Not Found - stop polling - this._shutDownNotifications(); + if (xhr.status === 503) { + // 503 - Maintenance mode + console.debug('Shutting down notifications: instance is in maintenance mode.'); + } else if (xhr.status === 404) { + // 404 - App disabled + console.debug('Shutting down notifications: app is disabled.'); } else { - OC.Notification.showTemporary('Failed to request notifications. Please try to refresh the page manually.'); + console.error('Shutting down notifications: [' + xhr.status + '] ' + xhr.statusText); } + this._shutDownNotifications(); }, /** |