diff options
author | Andinus <andinus@nand.sh> | 2022-08-09 14:30:22 +0530 |
---|---|---|
committer | Andinus <andinus@nand.sh> | 2022-08-09 14:30:22 +0530 |
commit | 7d94c886b578a2277bfec4392eab4871cc7ee1dd (patch) | |
tree | 44762e5d1b00576e505914736771f3d8129d710c /draco.pl | |
parent | 2e8123b1c76df4f9e8feb1b78863a1c8f4f96644 (diff) | |
download | draco-7d94c886b578a2277bfec4392eab4871cc7ee1dd.tar.gz |
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.
Diffstat (limited to 'draco.pl')
-rwxr-xr-x | draco.pl | 2 |
1 files changed, 1 insertions, 1 deletions
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; } |