Unverified Commit 2123a67b authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

IRIS->get_departures_p: return string in first rejection argument

This is consistent with other promises within travelynx
parent 1074f248
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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 =>
+3 −0
Original line number Diff line number Diff line
@@ -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',