summaryrefslogtreecommitdiff
path: root/lib/Travel/Routing/DE/VRR.pm
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2011-06-28 08:47:23 +0200
committerDaniel Friesel <derf@finalrewind.org>2011-06-28 08:47:23 +0200
commit7e214984c064709e59a74a784f5776493f763c50 (patch)
treeadec4967e4f9f67aeca096df4dc5d8704960db62 /lib/Travel/Routing/DE/VRR.pm
parentf9fa576b785d8640f36a2cdc79ef685ca8336be5 (diff)
VRR.pm: HTTP request error handling
Diffstat (limited to 'lib/Travel/Routing/DE/VRR.pm')
-rw-r--r--lib/Travel/Routing/DE/VRR.pm5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Travel/Routing/DE/VRR.pm b/lib/Travel/Routing/DE/VRR.pm
index c73d033..695feaa 100644
--- a/lib/Travel/Routing/DE/VRR.pm
+++ b/lib/Travel/Routing/DE/VRR.pm
@@ -448,6 +448,11 @@ sub submit {
my $response = $self->{ua}
->post( 'http://efa.vrr.de/vrr/XSLT_TRIP_REQUEST2', $self->{post} );
+ if ( $response->is_error ) {
+ my $errstr = $response->status_line;
+ confess("Could not submit POST request: ${errstr}");
+ }
+
# XXX (workaround)
# The content actually is iso-8859-1. But HTML::Message doesn't actually
# decode character strings when they have that encoding. However, it