From 3557cfb0c021747caf5a5d2cbb192ac60c0c97bd Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Mon, 31 Jan 2011 18:50:40 +0100 Subject: Improve(?) error handling --- bin/efa | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'bin') diff --git a/bin/efa b/bin/efa index 1206f2c..4e4333b 100755 --- a/bin/efa +++ b/bin/efa @@ -97,8 +97,8 @@ $efa = WWW::Efa->new( max_interchanges => $opt->{'max-change'}, ); -if (my $err = $efa->setup_error()) { - die $err->as_string(); +if ($efa->error()) { + die $efa->error()->as_string(); } if ($opt->{'test-parse'}) { @@ -111,11 +111,7 @@ else { ); } -my $err = $efa->parse(); - -if ($err and $err->isa('WWW::Efa::Error')) { - die $err->as_string(); -} +$efa->parse or die $efa->error()->as_string(); my @connections = $efa->connections(); -- cgit v1.2.3