From 5b88a4bb3d1bbf64e4985deb034b7cd4a265d26a Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Sun, 9 Jul 2023 17:42:12 +0200 Subject: station board: fix HTTP status and IRIS error handling --- lib/Travelynx/Controller/Traveling.pm | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'lib') 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; -- cgit v1.2.3