summaryrefslogtreecommitdiff
path: root/bin/efa
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2010-08-06 22:08:14 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2010-08-06 22:08:14 +0200
commita30be50b746055a1474b90b8bdf01a34776f535d (patch)
tree6e6fd847e72cfd8e01939fd776c17bfc09b98ee6 /bin/efa
parentee38a4b7cdf0032e35e8249eb45d255480895119 (diff)
Fix internal error handling + tests for it
Diffstat (limited to 'bin/efa')
-rwxr-xr-xbin/efa10
1 files changed, 9 insertions, 1 deletions
diff --git a/bin/efa b/bin/efa
index 55695f9..d6f7cef 100755
--- a/bin/efa
+++ b/bin/efa
@@ -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>;