Mercurial > gemma
comparison client/src/components/systemconfiguration/PDFTemplates.vue @ 2522:24bab584f0a1
client: improved error message format for pdf-template uploads
author | Markus Kottlaender <markus@intevation.de> |
---|---|
date | Wed, 06 Mar 2019 10:48:18 +0100 |
parents | 9ae2a2f758bb |
children | 1a6553da9078 |
comparison
equal
deleted
inserted
replaced
2521:e26000628764 | 2522:24bab584f0a1 |
---|---|
117 template.name + " " + this.$gettext("uploaded successfully") | 117 template.name + " " + this.$gettext("uploaded successfully") |
118 }); | 118 }); |
119 }) | 119 }) |
120 .catch(e => { | 120 .catch(e => { |
121 const { status, data } = e.response; | 121 const { status, data } = e.response; |
122 displayError({ | 122 if (status === 400) { |
123 title: this.$gettext("Backend Error"), | 123 displayError({ |
124 message: `${status}: ${data.message || data}` | 124 title: this.$gettext("Error"), |
125 }); | 125 message: `${data.message || data}` |
126 }); | |
127 } else { | |
128 displayError({ | |
129 title: this.$gettext("Backend Error"), | |
130 message: `${status}: ${data.message || data}` | |
131 }); | |
132 } | |
126 }) | 133 }) |
127 .finally(() => { | 134 .finally(() => { |
128 this.uploading = false; | 135 this.uploading = false; |
129 this.$refs.uploadTemplate.value = null; | 136 this.$refs.uploadTemplate.value = null; |
130 }); | 137 }); |