diff options
author | Daniel Friesel <derf@finalrewind.org> | 2011-06-28 08:47:23 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2011-06-28 08:47:23 +0200 |
commit | 7e214984c064709e59a74a784f5776493f763c50 (patch) | |
tree | adec4967e4f9f67aeca096df4dc5d8704960db62 /lib/Travel/Routing/DE/VRR.pm | |
parent | f9fa576b785d8640f36a2cdc79ef685ca8336be5 (diff) |
VRR.pm: HTTP request error handling
Diffstat (limited to 'lib/Travel/Routing/DE/VRR.pm')
-rw-r--r-- | lib/Travel/Routing/DE/VRR.pm | 5 |
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 |