public override AmazonServiceException UnmarshallException(XmlUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode)
{
var errorResponse = Amazon.S3.Model.Internal.MarshallTransformations.S3ErrorResponseUnmarshaller.Instance.Unmarshall(context);
var s3Exception = new Amazon.S3.AmazonS3Exception(errorResponse.Message, innerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, statusCode, errorResponse.Id2, errorResponse.AmzCfId);
s3Exception.Region = errorResponse.Region;
if (errorResponse.ParsingException != null)
{
var body = context.ResponseBody;
if (!string.IsNullOrEmpty(body))
{
s3Exception.ResponseBody = body;
}
}
return s3Exception;
}
}