Parse error message only from bodyBuffer (#380)

This commit is contained in:
JinmingHu 2020-08-04 09:53:22 +08:00 committed by GitHub
parent 5426cf7a07
commit 18b02094ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,6 +4,7 @@
#include "common/storage_error.hpp"
#include "common/constants.hpp"
#include "common/storage_common.hpp"
#include "common/xml_wrapper.hpp"
#include "http/policy.hpp"
#include "json.hpp"
@ -15,16 +16,8 @@ namespace Azure { namespace Storage {
Azure::Core::Context context,
std::unique_ptr<Azure::Core::Http::RawResponse> response)
{
std::vector<uint8_t> bodyBuffer;
auto bodyStream = response->GetBodyStream();
if (bodyStream)
{
bodyBuffer = Azure::Core::Http::BodyStream::ReadToEnd(context, *bodyStream);
}
else
{
bodyBuffer = std::move(response->GetBody());
}
unused(context);
std::vector<uint8_t> bodyBuffer = std::move(response->GetBody());
auto httpStatusCode = response->GetStatusCode();
std::string reasonPhrase = response->GetReasonPhrase();