diff options
Diffstat (limited to 'app/assets/javascripts/monitoring/requests/index.js')
-rw-r--r-- | app/assets/javascripts/monitoring/requests/index.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/app/assets/javascripts/monitoring/requests/index.js b/app/assets/javascripts/monitoring/requests/index.js index 8b65eec051f..29786a79c56 100644 --- a/app/assets/javascripts/monitoring/requests/index.js +++ b/app/assets/javascripts/monitoring/requests/index.js @@ -1,7 +1,9 @@ import axios from '~/lib/utils/axios_utils'; import { backOff } from '~/lib/utils/common_utils'; -import statusCodes, { +import { + HTTP_STATUS_BAD_REQUEST, HTTP_STATUS_NO_CONTENT, + HTTP_STATUS_SERVICE_UNAVAILABLE, HTTP_STATUS_UNPROCESSABLE_ENTITY, } from '~/lib/utils/http_status'; import { PROMETHEUS_TIMEOUT } from '../constants'; @@ -36,9 +38,9 @@ export const getPrometheusQueryData = (prometheusEndpoint, params, opts) => // https://prometheus.io/docs/prometheus/latest/querying/api/#format-overview const { response = {} } = error; if ( - response.status === statusCodes.BAD_REQUEST || + response.status === HTTP_STATUS_BAD_REQUEST || response.status === HTTP_STATUS_UNPROCESSABLE_ENTITY || - response.status === statusCodes.SERVICE_UNAVAILABLE + response.status === HTTP_STATUS_SERVICE_UNAVAILABLE ) { const { data } = response; if (data?.status === 'error' && data?.error) { |