summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndinus <andinus@nand.sh>2022-08-09 14:30:22 +0530
committerAndinus <andinus@nand.sh>2022-08-09 14:30:22 +0530
commit7d94c886b578a2277bfec4392eab4871cc7ee1dd (patch)
tree44762e5d1b00576e505914736771f3d8129d710c
parent2e8123b1c76df4f9e8feb1b78863a1c8f4f96644 (diff)
downloaddraco-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.
-rwxr-xr-xdraco.pl2
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;
 }