From e307a8443dede3013016167031720d53b527dd7a Mon Sep 17 00:00:00 2001 From: gaurav Date: Fri, 27 May 2016 19:30:11 +0530 Subject: Improved error reporting from WWW::Pocket and displaying HTTP::Tiny errors. Also: added IO::Socket::SSL so it appears as a pre-req for this program. --- lib/WWW/Pocket.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/WWW/Pocket.pm b/lib/WWW/Pocket.pm index 645f30c..6567a94 100644 --- a/lib/WWW/Pocket.pm +++ b/lib/WWW/Pocket.pm @@ -3,7 +3,9 @@ use Moose; # ABSTRACT: Wrapper for the Pocket v3 API use HTTP::Tiny; +use IO::Socket::SSL; # Necessary for https URLs on HTTP::Tiny. use JSON::PP; +use Carp; =head1 SYNOPSIS @@ -263,7 +265,7 @@ sub _request { }, }, ); - die "Request for $uri failed ($response->{status}): $response->{reason}" + croak "Request for $uri failed ($response->{status}): $response->{content}" unless $response->{success}; return decode_json($response->{content}); -- cgit v1.2.3-54-g00ecf