diff options
author | kushalpandya <kushal@gitlab.com> | 2017-06-01 15:05:15 +0530 |
---|---|---|
committer | kushalpandya <kushal@gitlab.com> | 2017-06-01 15:05:15 +0530 |
commit | afc1a67d19c077bc61350a01d6a0f7e676e5a0f6 (patch) | |
tree | e62cbe992b3bd5cf87ae758da6d0a046789dc727 | |
parent | 4826ae074f2757e2ca7cddbb201688a11bcf8f8b (diff) | |
download | gitlab-ce-afc1a67d19c077bc61350a01d6a0f7e676e5a0f6.tar.gz |
Handle response failure case for loadActiveMetrics
-rw-r--r-- | app/assets/javascripts/prometheus_metrics/prometheus_metrics.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/app/assets/javascripts/prometheus_metrics/prometheus_metrics.js b/app/assets/javascripts/prometheus_metrics/prometheus_metrics.js index b44fdcc9dc4..d83e85b2026 100644 --- a/app/assets/javascripts/prometheus_metrics/prometheus_metrics.js +++ b/app/assets/javascripts/prometheus_metrics/prometheus_metrics.js @@ -1,5 +1,3 @@ -/* eslint-disable class-methods-use-this, promise/catch-or-return */ - export default class PrometheusMetrics { constructor(wrapperSelector) { this.backOffRequestCounter = 0; @@ -24,6 +22,7 @@ export default class PrometheusMetrics { this.$panelToggle.on('click', e => this.handlePanelToggle(e)); } + /* eslint-disable class-methods-use-this */ handlePanelToggle(e) { const $toggleBtn = $(e.currentTarget); const $currentPanelBody = $toggleBtn.parents('.panel').find('.panel-body'); @@ -84,6 +83,10 @@ export default class PrometheusMetrics { this.$monitoredMetricsLoading.addClass('hidden'); this.$monitoredMetricsEmpty.removeClass('hidden'); } + }) + .catch(() => { + this.$monitoredMetricsLoading.addClass('hidden'); + this.$monitoredMetricsEmpty.removeClass('hidden'); }); } } |