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(
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;