Verbessere Fehlerbehandlung beim Geschenkeversand: Füge Unterstützung für Retry-Nachricht und verbessere die Lokalisierung der Fehlermeldungen in FamilyView hinzu.
This commit is contained in:
@@ -355,15 +355,16 @@ export default {
|
||||
console.log(error.response);
|
||||
if (error.response?.status === 412) {
|
||||
const retryAtIso = error.response?.data?.retryAt;
|
||||
const code = error.response?.data?.error || error.response?.data?.message;
|
||||
if (retryAtIso) {
|
||||
const retryStr = new Date(retryAtIso).toLocaleString(navigator.language, {
|
||||
year: 'numeric', month: '2-digit', day: '2-digit',
|
||||
hour: '2-digit', minute: '2-digit'
|
||||
});
|
||||
const baseMsg = this.$t(`falukant.family.sendgift.error.${error.response.data.error}`);
|
||||
const baseMsg = this.$t(`falukant.family.sendgift.error.${code}`);
|
||||
this.$root.$refs.errorDialog.open(`${baseMsg} — ${this.$t('falukant.family.sendgift.nextGiftAt')}: ${retryStr}`);
|
||||
} else {
|
||||
this.$root.$refs.errorDialog.open(`tr:falukant.family.sendgift.error.${error.response.data.error}`);
|
||||
this.$root.$refs.errorDialog.open(`tr:falukant.family.sendgift.error.${code}`);
|
||||
}
|
||||
} else {
|
||||
this.$root.$refs.errorDialog.open(`tr:falukant.family.sendgift.error.generic`);
|
||||
|
||||
Reference in New Issue
Block a user