diff options
author | Daniel Friesel <derf@derf.homelinux.org> | 2010-08-06 22:08:14 +0200 |
---|---|---|
committer | Daniel Friesel <derf@derf.homelinux.org> | 2010-08-06 22:08:14 +0200 |
commit | a30be50b746055a1474b90b8bdf01a34776f535d (patch) | |
tree | 6e6fd847e72cfd8e01939fd776c17bfc09b98ee6 /bin/efa | |
parent | ee38a4b7cdf0032e35e8249eb45d255480895119 (diff) |
Fix internal error handling + tests for it
Diffstat (limited to 'bin/efa')
-rwxr-xr-x | bin/efa | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -88,7 +88,7 @@ $efa = WWW::Efa->new( via => (@via ? [@via, $via_type] : undef), arrive => $opt->{'arrive'}, - depart => $opt->{'depart'}, + depart => $opt->{'depart'} // $opt->{'time'}, date => $opt->{'date'}, exclude => $opt->{'exclude'}, prefer => $opt->{'prefer'}, @@ -100,6 +100,14 @@ $efa = WWW::Efa->new( max_interchanges => $opt->{'max-change'}, ); +if ($efa->{'error'}) { + die $efa->{'error'}->as_string(); +} + +if (ref($efa) eq 'WWW::Efa::Error') { + die($efa->as_string); +} + if ($opt->{'test-parse'}) { local $/ = undef; $efa->{'html_reply'} = <STDIN>; |