comparison client/src/components/Logs.vue @ 4868:008bc1ae8897

exception handling
author Thomas Junk <thomas.junk@intevation.de>
date Tue, 17 Dec 2019 15:05:56 +0100
parents 1b8bb4f89227
children 6b054b91d9b2
comparison
equal deleted inserted replaced
4867:5555b77b8c4e 4868:008bc1ae8897
155 this.logs = response.data.content; 155 this.logs = response.data.content;
156 this.currentLog = type; 156 this.currentLog = type;
157 this.refreshed = new Date().toLocaleString(); 157 this.refreshed = new Date().toLocaleString();
158 this.currentFile = file; 158 this.currentFile = file;
159 }) 159 })
160 .catch(e => { 160 .catch(error => {
161 const { status, data } = e.response; 161 let message = "Problems with backend";
162 if (error.response) {
163 const { status, data } = error.response;
164 message = `${status}: ${data.message || data}`;
165 }
162 displayError({ 166 displayError({
163 title: this.$gettext("Backend Error"), 167 title: this.$gettext("Backend Error"),
164 message: `${status} ${data.message || data}` 168 message: message
165 }); 169 });
166 }); 170 });
167 }, 171 },
168 disallow(e) { 172 disallow(e) {
169 e.target.blur(); 173 e.target.blur();