diff options
author | Daniel Friesel <derf@finalrewind.org> | 2011-01-31 18:50:40 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2011-01-31 18:50:40 +0100 |
commit | 3557cfb0c021747caf5a5d2cbb192ac60c0c97bd (patch) | |
tree | 71474aee7e39eeb0d6f0d51cde65c241ddfb5efb /bin/efa | |
parent | 5dc6d0789474de48cf38650cae648c2367477cf7 (diff) |
Improve(?) error handling
Diffstat (limited to 'bin/efa')
-rwxr-xr-x | bin/efa | 10 |
1 files changed, 3 insertions, 7 deletions
@@ -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(); |