From 7d94c886b578a2277bfec4392eab4871cc7ee1dd Mon Sep 17 00:00:00 2001 From: Andinus Date: Tue, 9 Aug 2022 14:30:22 +0530 Subject: Print $response->{content} on failure From https://metacpan.org/pod/HTTP::Tiny, Errors during request execution will result in a pseudo-HTTP status code of 599 and a reason of "Internal Exception". The content field in the response will contain the text of the error. --- draco.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/draco.pl b/draco.pl index 4dddcad..c659942 100755 --- a/draco.pl +++ b/draco.pl @@ -152,7 +152,7 @@ sub get_response { print STDERR "." if $DEBUG and scalar @http_calls > 0; my $response = $http->get($url); push @http_calls, $url; - die "Unexpected response - $response->{status}: $response->{reason} : $url" + die "\nUnexpected response - $response->{status}: $response->{reason}\n$response->{content} : $url" unless $response->{success}; return $response; } -- cgit 1.4.1-2-gfad0