Unverified Commit 8eb02b82 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

hafas-m: add error check when redirecting from journey match to journey details

parent 2f14e974
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -322,6 +322,19 @@ if ( $opt{journeyMatch} ) {
		$opt{journey} = { id => $journey->id };
		delete $opt{journeyMatch};
		$status = Travel::Status::DE::HAFAS->new(%opt);
		if ( my $err = $status->errstr ) {
			say STDERR "Request error: ${err}";
			if (
				$status->errcode
				and
				( $status->errcode eq 'H730' or $status->errcode eq 'LOCATION' )
				and not $raw_json_output
			  )
			{
				show_similar_stops();
			}
			exit 2;
		}
	}
	else {
		for my $result ( $status->results ) {