Skip to content

Commit

Permalink
🐛 Add fallback alert for all other errors than 422 (#2474)
Browse files Browse the repository at this point in the history
  • Loading branch information
HerrLevin authored Apr 5, 2024
1 parent 8d90c8a commit 666c723
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions lang/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@
"messages.cookie-notice-button": "Okay",
"messages.cookie-notice-learn": "Mehr erfahren",
"messages.exception.general": "Ein unbekannter Fehler ist aufgetreten. Bitte probiere es erneut.",
"messages.exception.general-values": "Ein unbekannter Fehler ist aufgetreten. Bitte probiere es mit neuen Werten erneut.",
"messages.exception.reference": "Fehler-Referenz: :reference",
"messages.exception.generalHafas": "Es gab ein Problem mit der Schnittstelle zu den Fahrplandaten. Bitte probiere es erneut.",
"messages.exception.hafas.502": "Der Fahrplan konnte nicht geladen werden. Bitte versuche es gleich erneut.",
Expand Down
1 change: 1 addition & 0 deletions lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@
"messages.cookie-notice-button": "Okay",
"messages.cookie-notice-learn": "Learn more",
"messages.exception.general": "An unknown error occurred. Please try again.",
"messages.exception.general-values": "An unknown error occurred. Please try again with different values.",
"messages.exception.reference": "Error reference: :reference",
"messages.exception.generalHafas": "There was a problem with the interface to the timetable data. Please try again.",
"messages.exception.hafas.502": "The timetable could not be loaded. Please try again in a moment.",
Expand Down
5 changes: 3 additions & 2 deletions resources/vue/components/TripCreation/TripCreationForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,12 @@ export default {
window.location.href = `/trains/trip/?${new URLSearchParams(query).toString()}`;
});
}
if (data.status === 422) {
} else if (data.status === 422) {
data.json().then((result) => {
alert(result.message);
});
} else {
alert(trans("messages.exception.general-values"));
}
});
},
Expand Down

0 comments on commit 666c723

Please sign in to comment.