station board: fix HTTP status and IRIS error handling

This commit is contained in:
Birte Kristina Friesel 2023-07-09 17:42:12 +02:00
parent 2123a67ba0
commit 5b88a4bb3d
No known key found for this signature in database
GPG key ID: 19E6E524EBB177BA

View file

@ -935,17 +935,22 @@ sub station {
} }
)->catch( )->catch(
sub { sub {
my ($err) = @_; my ( $err, $status ) = @_;
if ( ref($err) eq 'HASH' ) { if ($status) {
$self->render( $self->render(
'landingpage', 'landingpage',
with_autocomplete => 1, with_autocomplete => 1,
with_geolocation => 1, with_geolocation => 1,
error => $err->{errstr}, error => $status->{errstr},
status => 400,
); );
} }
else { else {
$self->render( 'exception', exception => $err ); $self->render(
'exception',
exception => $err,
status => 500
);
} }
} }
)->wait; )->wait;