Skip to content

Instantly share code, notes, and snippets.

@zby
Created August 2, 2009 08:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zby/159997 to your computer and use it in GitHub Desktop.
Save zby/159997 to your computer and use it in GitHub Desktop.
--- lib/LWPx/ParanoidAgent.pm (revision 18)
+++ lib/LWPx/ParanoidAgent.pm (working copy)
@@ -314,11 +314,12 @@
$response = $protocol->request($request, $proxy,
$arg, $size, $timeout);
};
- if ($@) {
- $@ =~ s/ at .* line \d+.*//s; # remove file/line number
+ my $error = $@ || $response->header( 'x-died' );
+ if ($error) {
+ $error =~ s/ at .* line \d+.*//s; # remove file/line number
$response = _new_response($request,
&HTTP::Status::RC_INTERNAL_SERVER_ERROR,
- $@);
+ $error);
}
}
else {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment