IRIS->get_departures_p: return string in first rejection argument
This is consistent with other promises within travelynx
This commit is contained in:
parent
1074f248cc
commit
2123a67ba0
2 changed files with 5 additions and 2 deletions
|
@ -488,7 +488,7 @@ sub startup {
|
|||
}
|
||||
)->catch(
|
||||
sub {
|
||||
my ($status) = @_;
|
||||
my ( $err, $status ) = @_;
|
||||
$promise->reject( $status->{errstr} );
|
||||
return;
|
||||
}
|
||||
|
@ -2009,7 +2009,7 @@ sub startup {
|
|||
}
|
||||
)->catch(
|
||||
sub {
|
||||
my ($dep) = @_;
|
||||
my ( $err, $dep ) = @_;
|
||||
$self->traewelling->log(
|
||||
uid => $uid,
|
||||
message =>
|
||||
|
|
|
@ -138,6 +138,7 @@ sub get_departures_p {
|
|||
sub {
|
||||
my ($err) = @_;
|
||||
$promise->reject(
|
||||
$err,
|
||||
{
|
||||
results => [],
|
||||
errstr => "Error in promise: $err",
|
||||
|
@ -150,6 +151,7 @@ sub get_departures_p {
|
|||
}
|
||||
elsif ( @station_matches > 1 ) {
|
||||
return Mojo::Promise->reject(
|
||||
'ambiguous station name',
|
||||
{
|
||||
results => [],
|
||||
errstr =>
|
||||
|
@ -160,6 +162,7 @@ sub get_departures_p {
|
|||
}
|
||||
else {
|
||||
return Mojo::Promise->reject(
|
||||
'unknown station',
|
||||
{
|
||||
results => [],
|
||||
errstr => 'Unbekannte Station',
|
||||
|
|
Loading…
Reference in a new issue