# HG changeset patch # User Thomas Junk # Date 1624363609 -7200 # Node ID 2578fd6f4c63b677692f1fdc179231cb39076a26 # Parent 979f139cde4d7d5f2fb975d31f447a0f05bbd092 changed DQL path to default. Added error handling. diff -r 979f139cde4d -r 2578fd6f4c63 client/src/components/identify/Identify.vue --- a/client/src/components/identify/Identify.vue Tue Jun 22 13:13:32 2021 +0200 +++ b/client/src/components/identify/Identify.vue Tue Jun 22 14:06:49 2021 +0200 @@ -284,6 +284,7 @@ import filters from "@/lib/filters"; import { HTTP } from "@/lib/http"; import { format } from "date-fns"; +import { displayError } from "@/lib/errors"; const { recencyColorCodes, @@ -421,20 +422,32 @@ }, methods: { downloadDataQualityReport() { - HTTP.get(`/data/report/gauges`, { + HTTP.get(`/data/report/default`, { responseType: "blob", headers: { "X-Gemma-Auth": localStorage.getItem("token") } - }).then(response => { - const link = document.createElement("a"); - const now = new Date(); - link.href = window.URL.createObjectURL(new Blob([response.data])); - link.download = `DataQualityReport-${format(now, "YYYY-MM-DD")}.xlsx`; - document.body.appendChild(link); - link.click(); - document.body.removeChild(link); - }); + }) + .then(response => { + const link = document.createElement("a"); + const now = new Date(); + link.href = window.URL.createObjectURL(new Blob([response.data])); + link.download = `DataQualityReport-${format(now, "YYYY-MM-DD")}.xlsx`; + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + }) + .catch(error => { + let message = "Backend not reachable"; + if (error.response) { + const { status, data } = error.response; + message = `${status}: ${data.message || data}`; + } + displayError({ + title: this.$gettext("Backend Error"), + message: message + }); + }); }, getGaugeStatusText(feature) { if (/bottleneck/.test(feature.getId())) return this.refGaugeStatusText;