From 7b46e5dc99fd7ad3e5dcd04771884e4a65ea6601 Mon Sep 17 00:00:00 2001 From: Mark Allen Date: Thu, 19 Apr 2012 14:42:15 -0500 Subject: [PATCH] Pass params to XML deserialization --- lib/Amazon/S3.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/Amazon/S3.pm b/lib/Amazon/S3.pm index f28255e..01a8006 100644 --- a/lib/Amazon/S3.pm +++ b/lib/Amazon/S3.pm @@ -370,7 +370,8 @@ sub _croak_if_response_error { } sub _xpc_of_content { - return XMLin($_[1], 'SuppressEmpty' => '', 'ForceArray' => ['Contents']); + my $self = shift; + return XMLin(shift, 'SuppressEmpty' => '', 'ForceArray' => ['Contents'], @_); } # returns 1 if errors were found @@ -384,8 +385,8 @@ sub _remember_errors { return 1; } - my $r = ref $src ? $src : $self->_xpc_of_content($src); - + my $r = ref $src ? $src : $self->_xpc_of_content($src, KeepRoot => 1); + if ($r->{Error}) { $self->err($r->{Error}{Code}); $self->errstr($r->{Error}{Message});