station board: fix HTTP status and IRIS error handling
This commit is contained in:
parent
2123a67ba0
commit
5b88a4bb3d
1 changed files with 9 additions and 4 deletions
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue