diff client/src/components/Logs.vue @ 2916:ea54e63deb40

client:logs:add catch method
author Fadi Abbud <fadi.abbud@intevation.de>
date Wed, 03 Apr 2019 15:32:59 +0200
parents bb5286acfee2
children 6c5364ff0abb
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();