Loading bin/efa +2 −2 Original line number Diff line number Diff line Loading @@ -75,8 +75,8 @@ sub handle_efa_exception { ); exit 4; } if ( $e->isa('Travel::Routing::DE::VRR::Exception::NoConnections') ) { printf STDERR ( "Error: %s: %s\n", $e->description, $e->error ); if ( $e->isa('Travel::Routing::DE::VRR::Exception::Other') ) { printf STDERR ( "Error: %s: %s\n", $e->description, $e->message ); exit 5; } Loading lib/Travel/Routing/DE/VRR.pm +11 −2 Original line number Diff line number Diff line Loading @@ -33,9 +33,10 @@ use Exception::Class ( description => 'ambiguous input', fields => [ 'post_key', 'possibilities' ], }, 'Travel::Routing::DE::VRR::Exception::NoConnections' => { 'Travel::Routing::DE::VRR::Exception::Other' => { isa => 'Travel::Routing::DE::VRR::Exception', description => 'got no connections', description => 'EFA backend returned an error', fields => ['message'], }, ); Loading Loading @@ -580,12 +581,20 @@ sub parse { my $xp_element = XML::LibXML::XPathExpression->new( '//itdItinerary/itdRouteList/itdRoute'); my $xp_err = XML::LibXML::XPathExpression->new( '//itdTripRequest/itdMessage[@type="error"]'); my $xp_odv = XML::LibXML::XPathExpression->new('//itdOdv'); for my $odv ( $tree->findnodes($xp_odv) ) { $self->check_ambiguous($odv); } my $err = ( $tree->findnodes($xp_err) )[0]; if ($err) { Travel::Routing::DE::VRR::Exception::Other->throw( message => $err->textContent ); } for my $part ( $tree->findnodes($xp_element) ) { $self->parse_part($part); } Loading Loading
bin/efa +2 −2 Original line number Diff line number Diff line Loading @@ -75,8 +75,8 @@ sub handle_efa_exception { ); exit 4; } if ( $e->isa('Travel::Routing::DE::VRR::Exception::NoConnections') ) { printf STDERR ( "Error: %s: %s\n", $e->description, $e->error ); if ( $e->isa('Travel::Routing::DE::VRR::Exception::Other') ) { printf STDERR ( "Error: %s: %s\n", $e->description, $e->message ); exit 5; } Loading
lib/Travel/Routing/DE/VRR.pm +11 −2 Original line number Diff line number Diff line Loading @@ -33,9 +33,10 @@ use Exception::Class ( description => 'ambiguous input', fields => [ 'post_key', 'possibilities' ], }, 'Travel::Routing::DE::VRR::Exception::NoConnections' => { 'Travel::Routing::DE::VRR::Exception::Other' => { isa => 'Travel::Routing::DE::VRR::Exception', description => 'got no connections', description => 'EFA backend returned an error', fields => ['message'], }, ); Loading Loading @@ -580,12 +581,20 @@ sub parse { my $xp_element = XML::LibXML::XPathExpression->new( '//itdItinerary/itdRouteList/itdRoute'); my $xp_err = XML::LibXML::XPathExpression->new( '//itdTripRequest/itdMessage[@type="error"]'); my $xp_odv = XML::LibXML::XPathExpression->new('//itdOdv'); for my $odv ( $tree->findnodes($xp_odv) ) { $self->check_ambiguous($odv); } my $err = ( $tree->findnodes($xp_err) )[0]; if ($err) { Travel::Routing::DE::VRR::Exception::Other->throw( message => $err->textContent ); } for my $part ( $tree->findnodes($xp_element) ) { $self->parse_part($part); } Loading