summary refs log tree commit diff
diff options
context:
space:
mode:
authorfranck cuny <franck@lumberjaph.net>2010-01-06 13:46:22 +0100
committerfranck cuny <franck@lumberjaph.net>2010-01-06 13:46:22 +0100
commit9e158fac8e2541a16db50009f9f4aecf42dcba5d (patch)
treebdda79a13ec59ad2663b8c3f9113092db8cd8602
parentChecking in changes prior to tagging of version 0.08. Changelog diff is: (diff)
downloadmoosex-net-api-9e158fac8e2541a16db50009f9f4aecf42dcba5d.tar.gz
return deserialized content and http response
-rw-r--r--lib/MooseX/Net/API.pm9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/MooseX/Net/API.pm b/lib/MooseX/Net/API.pm
index 9b1d0fe..defbe2c 100644
--- a/lib/MooseX/Net/API.pm
+++ b/lib/MooseX/Net/API.pm
@@ -242,7 +242,14 @@ sub net_api_method {
                     @deserialize_order );
             }
 
-            return $content if ( $res->is_success );
+            if ( $res->is_success ) {
+                if (wantarray) {
+                    return ( $content, $res );
+                }
+                else {
+                    return $content;
+                }
+            }
 
             die MooseX::Net::API::Error->new(
                 http_error => $res,