diff options
author | Birte Kristina Friesel <derf@finalrewind.org> | 2023-07-09 17:42:12 +0200 |
---|---|---|
committer | Birte Kristina Friesel <derf@finalrewind.org> | 2023-07-09 17:42:12 +0200 |
commit | 5b88a4bb3d1bbf64e4985deb034b7cd4a265d26a (patch) | |
tree | af4e2c19c27c004846c819550c67159de0669b53 /lib/Travelynx/Controller/Traveling.pm | |
parent | 2123a67ba0e1b03e1c286bd2d39e6771cc9f145b (diff) |
station board: fix HTTP status and IRIS error handling
Diffstat (limited to 'lib/Travelynx/Controller/Traveling.pm')
-rwxr-xr-x | lib/Travelynx/Controller/Traveling.pm | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/Travelynx/Controller/Traveling.pm b/lib/Travelynx/Controller/Traveling.pm index 96acdd2..85c4e8a 100755 --- a/lib/Travelynx/Controller/Traveling.pm +++ b/lib/Travelynx/Controller/Traveling.pm @@ -935,17 +935,22 @@ sub station { } )->catch( sub { - my ($err) = @_; - if ( ref($err) eq 'HASH' ) { + my ( $err, $status ) = @_; + if ($status) { $self->render( 'landingpage', with_autocomplete => 1, with_geolocation => 1, - error => $err->{errstr}, + error => $status->{errstr}, + status => 400, ); } else { - $self->render( 'exception', exception => $err ); + $self->render( + 'exception', + exception => $err, + status => 500 + ); } } )->wait; |