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

exception handling
author Thomas Junk <thomas.junk@intevation.de>
date Tue, 17 Dec 2019 15:05:56 +0100
parents 3eb19b38446e
children 6b054b91d9b2
comparison
equal deleted inserted replaced
4867:5555b77b8c4e 4868:008bc1ae8897
156 if (this.isAuthenticated) { 156 if (this.isAuthenticated) {
157 this.notificationTimer = setTimeout(updateIndicators, 15000); 157 this.notificationTimer = setTimeout(updateIndicators, 15000);
158 } 158 }
159 }) 159 })
160 .catch(error => { 160 .catch(error => {
161 const { status, data } = error.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: "Backend Error", 167 title: this.$gettext("Backend Error"),
164 message: `${status}: ${data.message || data}` 168 message: message
165 }); 169 });
166 }); 170 });
167 } 171 }
168 }; 172 };
169 updateIndicators(); 173 updateIndicators();