Mercurial > gemma
changeset 2916:ea54e63deb40
client:logs:add catch method
author | Fadi Abbud <fadi.abbud@intevation.de> |
---|---|
date | Wed, 03 Apr 2019 15:32:59 +0200 |
parents | 69292eb68984 |
children | edc2633c3cc6 |
files | client/src/components/Logs.vue |
diffstat | 1 files changed, 8 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/client/src/components/Logs.vue Wed Apr 03 15:26:39 2019 +0200 +++ b/client/src/components/Logs.vue Wed Apr 03 15:32:59 2019 +0200 @@ -117,6 +117,7 @@ import "../../node_modules/highlight.js/styles/paraiso-dark.css"; import Vue from "vue"; import VueHighlightJS from "vue-highlightjs"; +import { displayError } from "@/lib/errors.js"; Vue.use(VueHighlightJS); const ACCESSLOG = "accesslog"; @@ -149,7 +150,13 @@ this.refreshed = new Date().toLocaleString(); this.currentFile = file; }) - .catch(); + .catch(e => { + const { status, data } = e.response; + displayError({ + title: this.$gettext("Backend Error"), + message: `${status} ${data.message || data}` + }); + }); }, disallow(e) { e.target.blur();