From 7e214984c064709e59a74a784f5776493f763c50 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Tue, 28 Jun 2011 08:47:23 +0200 Subject: VRR.pm: HTTP request error handling --- lib/Travel/Routing/DE/VRR.pm | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib') 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 -- cgit v1.2.3