Commit 6e859663 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

Save problematic place/name in Setup Exception and forward it to the user

parent 88800720
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -85,8 +85,9 @@ sub handle_efa_exception {
	if ( $e->isa('Travel::Routing::DE::EFA::Exception::Setup') ) {
		if ( $e->message ) {
			printf STDERR (
				"User error: %s (option '%s'): %s\n",
				$e->description, $e->option, $e->message
				"User error: %s (option '%s'): %s%s\n",
				$e->description, $e->option, $e->message,
				$e->have ? q{ "} . $e->have . q{"} : q{},
			);
		}
		else {
+4 −2
Original line number Diff line number Diff line
@@ -839,13 +839,15 @@ sub check_ambiguous_xml {
	if ( $s_place eq 'notidentified' ) {
		Travel::Routing::DE::EFA::Exception::Setup->throw(
			option => 'place',
			error  => 'unknown place (typo?)'
			error  => 'unknown place',
			have   => ( $e_place->findnodes($xp_place_input) )[0]->textContent,
		);
	}
	if ( $s_name eq 'notidentified' ) {
		Travel::Routing::DE::EFA::Exception::Setup->throw(
			option => 'name',
			error  => 'unknown name (typo?)'
			error  => 'unknown name',
			have   => ( $e_name->findnodes($xp_name_input) )[0]->textContent,
		);
	}