summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2024-04-24 20:04:54 +0200
committerBirte Kristina Friesel <derf@finalrewind.org>2024-04-24 20:04:54 +0200
commitdd1b29bc9a1813bc2151635f98231213d3453e78 (patch)
tree9e31477e2edbef104b7a4cf5c1ce645cdec7b91d
parentf51b692a69bb6efdba4017e30b16e2a29d783bfc (diff)
/z/:train/*station: fix 404 respons for JSON requests4.26.0
-rw-r--r--lib/DBInfoscreen/Controller/Stationboard.pm19
1 files changed, 14 insertions, 5 deletions
diff --git a/lib/DBInfoscreen/Controller/Stationboard.pm b/lib/DBInfoscreen/Controller/Stationboard.pm
index 6893cc0..84fac61 100644
--- a/lib/DBInfoscreen/Controller/Stationboard.pm
+++ b/lib/DBInfoscreen/Controller/Stationboard.pm
@@ -1098,11 +1098,20 @@ sub station_train_details {
)->catch(
sub {
my ($errstr) = @_;
- $self->render(
- 'landingpage',
- error =>
- "Keine Abfahrt von $train_no in $station gefunden: $errstr",
- status => 404,
+ $self->respond_to(
+ json => {
+ json => {
+ error =>
+"Keine Abfahrt von $train_no in $station gefunden: $errstr",
+ },
+ status => 404,
+ },
+ any => {
+ template => 'landingpage',
+ error =>
+"Keine Abfahrt von $train_no in $station gefunden: $errstr",
+ status => 404,
+ },
);
return;
}