Remove context from StorageError::CreateFromResponse (#511)

* Remove context from StorageError::CreateFromResponse

* Resolved issues in datalake/file protocol layer

Co-authored-by: Tank Tang <kat@microsoft.com>
This commit is contained in:
JinmingHu 2020-08-25 14:38:18 +08:00 committed by GitHub
parent 38241bb152
commit cf08d39d14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 190 additions and 134 deletions

View File

@ -1640,7 +1640,7 @@ namespace Azure { namespace Storage { namespace Blobs {
httpResponse.GetStatusCode());
if (!(http_status_code == 200))
{
throw StorageError::CreateFromResponse(context, std::move(pHttpResponse));
throw StorageError::CreateFromResponse(std::move(pHttpResponse));
}
{
const auto& httpResponseBody = httpResponse.GetBody();
@ -1693,7 +1693,7 @@ namespace Azure { namespace Storage { namespace Blobs {
httpResponse.GetStatusCode());
if (!(http_status_code == 200))
{
throw StorageError::CreateFromResponse(context, std::move(pHttpResponse));
throw StorageError::CreateFromResponse(std::move(pHttpResponse));
}
{
const auto& httpResponseBody = httpResponse.GetBody();
@ -1733,7 +1733,7 @@ namespace Azure { namespace Storage { namespace Blobs {
httpResponse.GetStatusCode());
if (!(http_status_code == 200))
{
throw StorageError::CreateFromResponse(context, std::move(pHttpResponse));
throw StorageError::CreateFromResponse(std::move(pHttpResponse));
}
{
const auto& httpResponseBody = httpResponse.GetBody();
@ -1785,7 +1785,7 @@ namespace Azure { namespace Storage { namespace Blobs {
httpResponse.GetStatusCode());
if (!(http_status_code == 202))
{
throw StorageError::CreateFromResponse(context, std::move(pHttpResponse));
throw StorageError::CreateFromResponse(std::move(pHttpResponse));
}
return Azure::Core::Response<SetServicePropertiesResult>(
std::move(response), std::move(pHttpResponse));
@ -1819,7 +1819,7 @@ namespace Azure { namespace Storage { namespace Blobs {
httpResponse.GetStatusCode());
if (!(http_status_code == 200))
{
throw StorageError::CreateFromResponse(context, std::move(pHttpResponse));
throw StorageError::CreateFromResponse(std::move(pHttpResponse));
}
response.SkuName = SkuNameFromString(httpResponse.GetHeaders().at("x-ms-sku-name"));
response.AccountKind
@ -1856,7 +1856,7 @@ namespace Azure { namespace Storage { namespace Blobs {
httpResponse.GetStatusCode());
if (!(http_status_code == 200))
{
throw StorageError::CreateFromResponse(context, std::move(pHttpResponse));
throw StorageError::CreateFromResponse(std::move(pHttpResponse));
}
{
const auto& httpResponseBody = httpResponse.GetBody();
@ -3188,7 +3188,7 @@ namespace Azure { namespace Storage { namespace Blobs {
httpResponse.GetStatusCode());
if (!(http_status_code == 201))
{
throw StorageError::CreateFromResponse(context, std::move(pHttpResponse));
throw StorageError::CreateFromResponse(std::move(pHttpResponse));
}
response.ETag = httpResponse.GetHeaders().at("etag");
response.LastModified = httpResponse.GetHeaders().at("last-modified");
@ -3238,7 +3238,7 @@ namespace Azure { namespace Storage { namespace Blobs {
httpResponse.GetStatusCode());
if (!(http_status_code == 202))
{
throw StorageError::CreateFromResponse(context, std::move(pHttpResponse));
throw StorageError::CreateFromResponse(std::move(pHttpResponse));
}
return Azure::Core::Response<DeleteContainerResult>(
std::move(response), std::move(pHttpResponse));
@ -3277,7 +3277,7 @@ namespace Azure { namespace Storage { namespace Blobs {
httpResponse.GetStatusCode());
if (!(http_status_code == 201))
{
throw StorageError::CreateFromResponse(context, std::move(pHttpResponse));
throw StorageError::CreateFromResponse(std::move(pHttpResponse));
}
return Azure::Core::Response<UndeleteContainerResult>(
std::move(response), std::move(pHttpResponse));
@ -3315,7 +3315,7 @@ namespace Azure { namespace Storage { namespace Blobs {
httpResponse.GetStatusCode());
if (!(http_status_code == 200))
{
throw StorageError::CreateFromResponse(context, std::move(pHttpResponse));
throw StorageError::CreateFromResponse(std::move(pHttpResponse));
}
response.ETag = httpResponse.GetHeaders().at("etag");
response.LastModified = httpResponse.GetHeaders().at("last-modified");
@ -3406,7 +3406,7 @@ namespace Azure { namespace Storage { namespace Blobs {
httpResponse.GetStatusCode());
if (!(http_status_code == 200))
{
throw StorageError::CreateFromResponse(context, std::move(pHttpResponse));
throw StorageError::CreateFromResponse(std::move(pHttpResponse));
}
response.ETag = httpResponse.GetHeaders().at("etag");
response.LastModified = httpResponse.GetHeaders().at("last-modified");
@ -3463,7 +3463,7 @@ namespace Azure { namespace Storage { namespace Blobs {
httpResponse.GetStatusCode());
if (!(http_status_code == 200))
{
throw StorageError::CreateFromResponse(context, std::move(pHttpResponse));
throw StorageError::CreateFromResponse(std::move(pHttpResponse));
}
{
const auto& httpResponseBody = httpResponse.GetBody();
@ -3529,7 +3529,7 @@ namespace Azure { namespace Storage { namespace Blobs {
httpResponse.GetStatusCode());
if (!(http_status_code == 200))
{
throw StorageError::CreateFromResponse(context, std::move(pHttpResponse));
throw StorageError::CreateFromResponse(std::move(pHttpResponse));
}
{
const auto& httpResponseBody = httpResponse.GetBody();
@ -3570,7 +3570,7 @@ namespace Azure { namespace Storage { namespace Blobs {
httpResponse.GetStatusCode());
if (!(http_status_code == 200))
{
throw StorageError::CreateFromResponse(context, std::move(pHttpResponse));
throw StorageError::CreateFromResponse(std::move(pHttpResponse));
}
{
const auto& httpResponseBody = httpResponse.GetBody();
@ -3647,7 +3647,7 @@ namespace Azure { namespace Storage { namespace Blobs {
httpResponse.GetStatusCode());
if (!(http_status_code == 200))
{
throw StorageError::CreateFromResponse(context, std::move(pHttpResponse));
throw StorageError::CreateFromResponse(std::move(pHttpResponse));
}
response.ETag = httpResponse.GetHeaders().at("etag");
response.LastModified = httpResponse.GetHeaders().at("last-modified");
@ -3702,7 +3702,7 @@ namespace Azure { namespace Storage { namespace Blobs {
httpResponse.GetStatusCode());
if (!(http_status_code == 201))
{
throw StorageError::CreateFromResponse(context, std::move(pHttpResponse));
throw StorageError::CreateFromResponse(std::move(pHttpResponse));
}
response.ETag = httpResponse.GetHeaders().at("etag");
response.LastModified = httpResponse.GetHeaders().at("last-modified");
@ -3753,7 +3753,7 @@ namespace Azure { namespace Storage { namespace Blobs {
httpResponse.GetStatusCode());
if (!(http_status_code == 200))
{
throw StorageError::CreateFromResponse(context, std::move(pHttpResponse));
throw StorageError::CreateFromResponse(std::move(pHttpResponse));
}
response.ETag = httpResponse.GetHeaders().at("etag");
response.LastModified = httpResponse.GetHeaders().at("last-modified");
@ -3806,7 +3806,7 @@ namespace Azure { namespace Storage { namespace Blobs {
httpResponse.GetStatusCode());
if (!(http_status_code == 200))
{
throw StorageError::CreateFromResponse(context, std::move(pHttpResponse));
throw StorageError::CreateFromResponse(std::move(pHttpResponse));
}
response.ETag = httpResponse.GetHeaders().at("etag");
response.LastModified = httpResponse.GetHeaders().at("last-modified");
@ -3857,7 +3857,7 @@ namespace Azure { namespace Storage { namespace Blobs {
httpResponse.GetStatusCode());
if (!(http_status_code == 200))
{
throw StorageError::CreateFromResponse(context, std::move(pHttpResponse));
throw StorageError::CreateFromResponse(std::move(pHttpResponse));
}
response.ETag = httpResponse.GetHeaders().at("etag");
response.LastModified = httpResponse.GetHeaders().at("last-modified");
@ -3911,7 +3911,7 @@ namespace Azure { namespace Storage { namespace Blobs {
httpResponse.GetStatusCode());
if (!(http_status_code == 202))
{
throw StorageError::CreateFromResponse(context, std::move(pHttpResponse));
throw StorageError::CreateFromResponse(std::move(pHttpResponse));
}
response.ETag = httpResponse.GetHeaders().at("etag");
response.LastModified = httpResponse.GetHeaders().at("last-modified");
@ -4888,7 +4888,7 @@ namespace Azure { namespace Storage { namespace Blobs {
httpResponse.GetStatusCode());
if (!(http_status_code == 200 || http_status_code == 206))
{
throw StorageError::CreateFromResponse(context, std::move(pHttpResponse));
throw StorageError::CreateFromResponse(std::move(pHttpResponse));
}
response.BodyStream = httpResponse.GetBodyStream();
response.ETag = httpResponse.GetHeaders().at("etag");
@ -5104,7 +5104,7 @@ namespace Azure { namespace Storage { namespace Blobs {
httpResponse.GetStatusCode());
if (!(http_status_code == 202))
{
throw StorageError::CreateFromResponse(context, std::move(pHttpResponse));
throw StorageError::CreateFromResponse(std::move(pHttpResponse));
}
return Azure::Core::Response<DeleteBlobResult>(
std::move(response), std::move(pHttpResponse));
@ -5138,7 +5138,7 @@ namespace Azure { namespace Storage { namespace Blobs {
httpResponse.GetStatusCode());
if (!(http_status_code == 200))
{
throw StorageError::CreateFromResponse(context, std::move(pHttpResponse));
throw StorageError::CreateFromResponse(std::move(pHttpResponse));
}
return Azure::Core::Response<UndeleteBlobResult>(
std::move(response), std::move(pHttpResponse));
@ -5212,7 +5212,7 @@ namespace Azure { namespace Storage { namespace Blobs {
httpResponse.GetStatusCode());
if (!(http_status_code == 200))
{
throw StorageError::CreateFromResponse(context, std::move(pHttpResponse));
throw StorageError::CreateFromResponse(std::move(pHttpResponse));
}
response.ETag = httpResponse.GetHeaders().at("etag");
response.LastModified = httpResponse.GetHeaders().at("last-modified");
@ -5484,7 +5484,7 @@ namespace Azure { namespace Storage { namespace Blobs {
httpResponse.GetStatusCode());
if (!(http_status_code == 200))
{
throw StorageError::CreateFromResponse(context, std::move(pHttpResponse));
throw StorageError::CreateFromResponse(std::move(pHttpResponse));
}
response.ETag = httpResponse.GetHeaders().at("etag");
response.LastModified = httpResponse.GetHeaders().at("last-modified");
@ -5588,7 +5588,7 @@ namespace Azure { namespace Storage { namespace Blobs {
httpResponse.GetStatusCode());
if (!(http_status_code == 200))
{
throw StorageError::CreateFromResponse(context, std::move(pHttpResponse));
throw StorageError::CreateFromResponse(std::move(pHttpResponse));
}
response.ETag = httpResponse.GetHeaders().at("etag");
response.LastModified = httpResponse.GetHeaders().at("last-modified");
@ -5633,7 +5633,7 @@ namespace Azure { namespace Storage { namespace Blobs {
httpResponse.GetStatusCode());
if (!(http_status_code == 200 || http_status_code == 202))
{
throw StorageError::CreateFromResponse(context, std::move(pHttpResponse));
throw StorageError::CreateFromResponse(std::move(pHttpResponse));
}
return Azure::Core::Response<SetBlobAccessTierResult>(
std::move(response), std::move(pHttpResponse));
@ -5753,7 +5753,7 @@ namespace Azure { namespace Storage { namespace Blobs {
httpResponse.GetStatusCode());
if (!(http_status_code == 202))
{
throw StorageError::CreateFromResponse(context, std::move(pHttpResponse));
throw StorageError::CreateFromResponse(std::move(pHttpResponse));
}
response.ETag = httpResponse.GetHeaders().at("etag");
response.LastModified = httpResponse.GetHeaders().at("last-modified");
@ -5805,7 +5805,7 @@ namespace Azure { namespace Storage { namespace Blobs {
httpResponse.GetStatusCode());
if (!(http_status_code == 204))
{
throw StorageError::CreateFromResponse(context, std::move(pHttpResponse));
throw StorageError::CreateFromResponse(std::move(pHttpResponse));
}
return Azure::Core::Response<AbortCopyBlobFromUriResult>(
std::move(response), std::move(pHttpResponse));
@ -5901,7 +5901,7 @@ namespace Azure { namespace Storage { namespace Blobs {
httpResponse.GetStatusCode());
if (!(http_status_code == 201))
{
throw StorageError::CreateFromResponse(context, std::move(pHttpResponse));
throw StorageError::CreateFromResponse(std::move(pHttpResponse));
}
response.ETag = httpResponse.GetHeaders().at("etag");
response.LastModified = httpResponse.GetHeaders().at("last-modified");
@ -5989,7 +5989,7 @@ namespace Azure { namespace Storage { namespace Blobs {
httpResponse.GetStatusCode());
if (!(http_status_code == 201))
{
throw StorageError::CreateFromResponse(context, std::move(pHttpResponse));
throw StorageError::CreateFromResponse(std::move(pHttpResponse));
}
response.ETag = httpResponse.GetHeaders().at("etag");
response.LastModified = httpResponse.GetHeaders().at("last-modified");
@ -6049,7 +6049,7 @@ namespace Azure { namespace Storage { namespace Blobs {
httpResponse.GetStatusCode());
if (!(http_status_code == 200))
{
throw StorageError::CreateFromResponse(context, std::move(pHttpResponse));
throw StorageError::CreateFromResponse(std::move(pHttpResponse));
}
response.ETag = httpResponse.GetHeaders().at("etag");
response.LastModified = httpResponse.GetHeaders().at("last-modified");
@ -6111,7 +6111,7 @@ namespace Azure { namespace Storage { namespace Blobs {
httpResponse.GetStatusCode());
if (!(http_status_code == 200))
{
throw StorageError::CreateFromResponse(context, std::move(pHttpResponse));
throw StorageError::CreateFromResponse(std::move(pHttpResponse));
}
response.ETag = httpResponse.GetHeaders().at("etag");
response.LastModified = httpResponse.GetHeaders().at("last-modified");
@ -6171,7 +6171,7 @@ namespace Azure { namespace Storage { namespace Blobs {
httpResponse.GetStatusCode());
if (!(http_status_code == 200))
{
throw StorageError::CreateFromResponse(context, std::move(pHttpResponse));
throw StorageError::CreateFromResponse(std::move(pHttpResponse));
}
response.ETag = httpResponse.GetHeaders().at("etag");
response.LastModified = httpResponse.GetHeaders().at("last-modified");
@ -6240,7 +6240,7 @@ namespace Azure { namespace Storage { namespace Blobs {
httpResponse.GetStatusCode());
if (!(http_status_code == 202))
{
throw StorageError::CreateFromResponse(context, std::move(pHttpResponse));
throw StorageError::CreateFromResponse(std::move(pHttpResponse));
}
response.ETag = httpResponse.GetHeaders().at("etag");
response.LastModified = httpResponse.GetHeaders().at("last-modified");
@ -6387,7 +6387,7 @@ namespace Azure { namespace Storage { namespace Blobs {
httpResponse.GetStatusCode());
if (!(http_status_code == 201))
{
throw StorageError::CreateFromResponse(context, std::move(pHttpResponse));
throw StorageError::CreateFromResponse(std::move(pHttpResponse));
}
response.ETag = httpResponse.GetHeaders().at("etag");
response.LastModified = httpResponse.GetHeaders().at("last-modified");
@ -6497,7 +6497,7 @@ namespace Azure { namespace Storage { namespace Blobs {
httpResponse.GetStatusCode());
if (!(http_status_code == 201))
{
throw StorageError::CreateFromResponse(context, std::move(pHttpResponse));
throw StorageError::CreateFromResponse(std::move(pHttpResponse));
}
auto response_content_md5_iterator = httpResponse.GetHeaders().find("content-md5");
if (response_content_md5_iterator != httpResponse.GetHeaders().end())
@ -6638,7 +6638,7 @@ namespace Azure { namespace Storage { namespace Blobs {
httpResponse.GetStatusCode());
if (!(http_status_code == 201))
{
throw StorageError::CreateFromResponse(context, std::move(pHttpResponse));
throw StorageError::CreateFromResponse(std::move(pHttpResponse));
}
auto response_content_md5_iterator = httpResponse.GetHeaders().find("content-md5");
if (response_content_md5_iterator != httpResponse.GetHeaders().end())
@ -6804,7 +6804,7 @@ namespace Azure { namespace Storage { namespace Blobs {
httpResponse.GetStatusCode());
if (!(http_status_code == 201))
{
throw StorageError::CreateFromResponse(context, std::move(pHttpResponse));
throw StorageError::CreateFromResponse(std::move(pHttpResponse));
}
response.ETag = httpResponse.GetHeaders().at("etag");
response.LastModified = httpResponse.GetHeaders().at("last-modified");
@ -6874,7 +6874,7 @@ namespace Azure { namespace Storage { namespace Blobs {
httpResponse.GetStatusCode());
if (!(http_status_code == 200))
{
throw StorageError::CreateFromResponse(context, std::move(pHttpResponse));
throw StorageError::CreateFromResponse(std::move(pHttpResponse));
}
{
const auto& httpResponseBody = httpResponse.GetBody();
@ -7169,7 +7169,7 @@ namespace Azure { namespace Storage { namespace Blobs {
httpResponse.GetStatusCode());
if (!(http_status_code == 201))
{
throw StorageError::CreateFromResponse(context, std::move(pHttpResponse));
throw StorageError::CreateFromResponse(std::move(pHttpResponse));
}
response.ETag = httpResponse.GetHeaders().at("etag");
response.LastModified = httpResponse.GetHeaders().at("last-modified");
@ -7314,7 +7314,7 @@ namespace Azure { namespace Storage { namespace Blobs {
httpResponse.GetStatusCode());
if (!(http_status_code == 201))
{
throw StorageError::CreateFromResponse(context, std::move(pHttpResponse));
throw StorageError::CreateFromResponse(std::move(pHttpResponse));
}
response.ETag = httpResponse.GetHeaders().at("etag");
response.LastModified = httpResponse.GetHeaders().at("last-modified");
@ -7471,7 +7471,7 @@ namespace Azure { namespace Storage { namespace Blobs {
httpResponse.GetStatusCode());
if (!(http_status_code == 201))
{
throw StorageError::CreateFromResponse(context, std::move(pHttpResponse));
throw StorageError::CreateFromResponse(std::move(pHttpResponse));
}
response.ETag = httpResponse.GetHeaders().at("etag");
response.LastModified = httpResponse.GetHeaders().at("last-modified");
@ -7611,7 +7611,7 @@ namespace Azure { namespace Storage { namespace Blobs {
httpResponse.GetStatusCode());
if (!(http_status_code == 201))
{
throw StorageError::CreateFromResponse(context, std::move(pHttpResponse));
throw StorageError::CreateFromResponse(std::move(pHttpResponse));
}
response.ETag = httpResponse.GetHeaders().at("etag");
response.LastModified = httpResponse.GetHeaders().at("last-modified");
@ -7737,7 +7737,7 @@ namespace Azure { namespace Storage { namespace Blobs {
httpResponse.GetStatusCode());
if (!(http_status_code == 200))
{
throw StorageError::CreateFromResponse(context, std::move(pHttpResponse));
throw StorageError::CreateFromResponse(std::move(pHttpResponse));
}
response.ETag = httpResponse.GetHeaders().at("etag");
response.LastModified = httpResponse.GetHeaders().at("last-modified");
@ -7825,7 +7825,7 @@ namespace Azure { namespace Storage { namespace Blobs {
httpResponse.GetStatusCode());
if (!(http_status_code == 200))
{
throw StorageError::CreateFromResponse(context, std::move(pHttpResponse));
throw StorageError::CreateFromResponse(std::move(pHttpResponse));
}
{
const auto& httpResponseBody = httpResponse.GetBody();
@ -7891,7 +7891,7 @@ namespace Azure { namespace Storage { namespace Blobs {
httpResponse.GetStatusCode());
if (!(http_status_code == 202))
{
throw StorageError::CreateFromResponse(context, std::move(pHttpResponse));
throw StorageError::CreateFromResponse(std::move(pHttpResponse));
}
response.ETag = httpResponse.GetHeaders().at("etag");
response.LastModified = httpResponse.GetHeaders().at("last-modified");
@ -8193,7 +8193,7 @@ namespace Azure { namespace Storage { namespace Blobs {
httpResponse.GetStatusCode());
if (!(http_status_code == 201))
{
throw StorageError::CreateFromResponse(context, std::move(pHttpResponse));
throw StorageError::CreateFromResponse(std::move(pHttpResponse));
}
response.ETag = httpResponse.GetHeaders().at("etag");
response.LastModified = httpResponse.GetHeaders().at("last-modified");
@ -8323,7 +8323,7 @@ namespace Azure { namespace Storage { namespace Blobs {
httpResponse.GetStatusCode());
if (!(http_status_code == 201))
{
throw StorageError::CreateFromResponse(context, std::move(pHttpResponse));
throw StorageError::CreateFromResponse(std::move(pHttpResponse));
}
response.ETag = httpResponse.GetHeaders().at("etag");
response.LastModified = httpResponse.GetHeaders().at("last-modified");
@ -8477,7 +8477,7 @@ namespace Azure { namespace Storage { namespace Blobs {
httpResponse.GetStatusCode());
if (!(http_status_code == 201))
{
throw StorageError::CreateFromResponse(context, std::move(pHttpResponse));
throw StorageError::CreateFromResponse(std::move(pHttpResponse));
}
response.ETag = httpResponse.GetHeaders().at("etag");
response.LastModified = httpResponse.GetHeaders().at("last-modified");
@ -8575,7 +8575,7 @@ namespace Azure { namespace Storage { namespace Blobs {
httpResponse.GetStatusCode());
if (!(http_status_code == 200))
{
throw StorageError::CreateFromResponse(context, std::move(pHttpResponse));
throw StorageError::CreateFromResponse(std::move(pHttpResponse));
}
response.ETag = httpResponse.GetHeaders().at("etag");
response.LastModified = httpResponse.GetHeaders().at("last-modified");

View File

@ -24,7 +24,6 @@ namespace Azure { namespace Storage {
std::unique_ptr<Azure::Core::Http::RawResponse> RawResponse;
static StorageError CreateFromResponse(
Azure::Core::Context context,
std::unique_ptr<Azure::Core::Http::RawResponse> response);
};
}} // namespace Azure::Storage

View File

@ -4,6 +4,7 @@
#pragma once
#include "common/storage_common.hpp"
#include "common/storage_error.hpp"
#include "http/http.hpp"
#include "http/pipeline.hpp"
@ -884,7 +885,8 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
}
else
{
throw Azure::Storage::StorageError::CreateFromResponse(context, std::move(responsePtr));
unused(context);
throw Azure::Storage::StorageError::CreateFromResponse(std::move(responsePtr));
}
}
};
@ -1206,7 +1208,8 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
}
else
{
throw Azure::Storage::StorageError::CreateFromResponse(context, std::move(responsePtr));
unused(context);
throw Azure::Storage::StorageError::CreateFromResponse(std::move(responsePtr));
}
}
@ -1226,7 +1229,8 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
}
else
{
throw Azure::Storage::StorageError::CreateFromResponse(context, std::move(responsePtr));
unused(context);
throw Azure::Storage::StorageError::CreateFromResponse(std::move(responsePtr));
}
}
@ -1248,7 +1252,8 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
}
else
{
throw Azure::Storage::StorageError::CreateFromResponse(context, std::move(responsePtr));
unused(context);
throw Azure::Storage::StorageError::CreateFromResponse(std::move(responsePtr));
}
}
@ -1266,7 +1271,8 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
}
else
{
throw Azure::Storage::StorageError::CreateFromResponse(context, std::move(responsePtr));
unused(context);
throw Azure::Storage::StorageError::CreateFromResponse(std::move(responsePtr));
}
}
@ -1293,7 +1299,8 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
}
else
{
throw Azure::Storage::StorageError::CreateFromResponse(context, std::move(responsePtr));
unused(context);
throw Azure::Storage::StorageError::CreateFromResponse(std::move(responsePtr));
}
}
};
@ -2670,7 +2677,8 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
}
else
{
throw Azure::Storage::StorageError::CreateFromResponse(context, std::move(responsePtr));
unused(context);
throw Azure::Storage::StorageError::CreateFromResponse(std::move(responsePtr));
}
}
@ -2755,7 +2763,8 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
}
else
{
throw Azure::Storage::StorageError::CreateFromResponse(context, std::move(responsePtr));
unused(context);
throw Azure::Storage::StorageError::CreateFromResponse(std::move(responsePtr));
}
}
@ -2801,7 +2810,8 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
}
else
{
throw Azure::Storage::StorageError::CreateFromResponse(context, std::move(responsePtr));
unused(context);
throw Azure::Storage::StorageError::CreateFromResponse(std::move(responsePtr));
}
}
@ -2945,7 +2955,8 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
}
else
{
throw Azure::Storage::StorageError::CreateFromResponse(context, std::move(responsePtr));
unused(context);
throw Azure::Storage::StorageError::CreateFromResponse(std::move(responsePtr));
}
}
@ -3049,7 +3060,8 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
}
else
{
throw Azure::Storage::StorageError::CreateFromResponse(context, std::move(responsePtr));
unused(context);
throw Azure::Storage::StorageError::CreateFromResponse(std::move(responsePtr));
}
}
@ -3071,7 +3083,8 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
}
else
{
throw Azure::Storage::StorageError::CreateFromResponse(context, std::move(responsePtr));
unused(context);
throw Azure::Storage::StorageError::CreateFromResponse(std::move(responsePtr));
}
}
@ -3091,7 +3104,8 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
}
else
{
throw Azure::Storage::StorageError::CreateFromResponse(context, std::move(responsePtr));
unused(context);
throw Azure::Storage::StorageError::CreateFromResponse(std::move(responsePtr));
}
}
@ -3121,7 +3135,8 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
}
else
{
throw Azure::Storage::StorageError::CreateFromResponse(context, std::move(responsePtr));
unused(context);
throw Azure::Storage::StorageError::CreateFromResponse(std::move(responsePtr));
}
}
@ -3147,7 +3162,8 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
}
else
{
throw Azure::Storage::StorageError::CreateFromResponse(context, std::move(responsePtr));
unused(context);
throw Azure::Storage::StorageError::CreateFromResponse(std::move(responsePtr));
}
}
@ -3165,7 +3181,8 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
}
else
{
throw Azure::Storage::StorageError::CreateFromResponse(context, std::move(responsePtr));
unused(context);
throw Azure::Storage::StorageError::CreateFromResponse(std::move(responsePtr));
}
}
};

View File

@ -4,6 +4,7 @@
#pragma once
#include "common/storage_common.hpp"
#include "common/storage_error.hpp"
#include "common/xml_wrapper.hpp"
#include "http/http.hpp"
@ -309,8 +310,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
// CORS request.
std::string ExposedHeaders; // The response headers that may be sent in the response to the CORS
// request and exposed by the browser to the request issuer.
int32_t MaxAgeInSeconds; // The maximum amount time that a browser should cache the preflight
// OPTIONS request.
int32_t MaxAgeInSeconds = int32_t(); // The maximum amount time that a browser should cache the
// preflight OPTIONS request.
};
// A listed directory item.
@ -322,11 +323,11 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
// File properties.
struct FileProperty
{
int64_t
ContentLength; // Content length of the file. This value may not be up-to-date since an SMB
// client may have modified the file locally. The value of Content-Length may
// not reflect that fact until the handle is closed or the op-lock is broken.
// To retrieve current property values, call Get File Properties.
int64_t ContentLength
= int64_t(); // Content length of the file. This value may not be up-to-date since an SMB
// client may have modified the file locally. The value of Content-Length may
// not reflect that fact until the handle is closed or the op-lock is broken.
// To retrieve current property values, call Get File Properties.
};
// A listed file item.
@ -366,7 +367,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
std::string DirectoryPath;
std::string Prefix;
std::string Marker;
int32_t MaxResults;
int32_t MaxResults = int32_t();
FilesAndDirectoriesListSegment Segment;
std::string NextMarker;
};
@ -383,13 +384,13 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
{
std::string LastModified;
std::string Etag;
int32_t Quota;
int32_t Quota = int32_t();
Azure::Core::Nullable<int32_t> ProvisionedIops;
Azure::Core::Nullable<int32_t> ProvisionedIngressMBps;
Azure::Core::Nullable<int32_t> ProvisionedEgressMBps;
Azure::Core::Nullable<std::string> NextAllowedQuotaDowngradeTime;
std::string DeletedTime;
int32_t RemainingRetentionDays;
int32_t RemainingRetentionDays = int32_t();
};
typedef std::map<std::string, std::string> Metadata;
@ -399,7 +400,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
{
std::string Name;
std::string Snapshot;
bool Deleted;
bool Deleted = bool();
std::string Version;
ShareProperties Properties;
Metadata ShareMetadata;
@ -411,7 +412,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
std::string ServiceEndpoint;
std::string Prefix;
std::string Marker;
int32_t MaxResults;
int32_t MaxResults = int32_t();
std::vector<ShareItem> ShareItems;
std::string NextMarker;
};
@ -419,36 +420,37 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
// The retention policy.
struct ShareRetentionPolicy
{
bool Enabled; // Indicates whether a retention policy is enabled for the File service. If false,
bool Enabled
= bool(); // Indicates whether a retention policy is enabled for the File service. If false,
// metrics data is retained, and the user is responsible for deleting it.
int32_t Days; // Indicates the number of days that metrics data should be retained. All data
// older than this value will be deleted. Metrics data is deleted on a best-effort
// basis after the retention period expires.
int32_t Days = int32_t(); // Indicates the number of days that metrics data should be retained.
// All data older than this value will be deleted. Metrics data is
// deleted on a best-effort basis after the retention period expires.
};
// Storage Analytics metrics for file service.
struct Metrics
{
std::string Version; // The version of Storage Analytics to configure.
bool Enabled; // Indicates whether metrics are enabled for the File service.
bool IncludeAPIs; // Indicates whether metrics should generate summary statistics for called API
// operations.
bool Enabled = bool(); // Indicates whether metrics are enabled for the File service.
bool IncludeAPIs = bool(); // Indicates whether metrics should generate summary statistics for
// called API operations.
ShareRetentionPolicy RetentionPolicy;
};
// An Azure Storage file range.
struct Range
{
int64_t Start; // Start of the range.
int64_t End; // End of the range.
int64_t Start = int64_t(); // Start of the range.
int64_t End = int64_t(); // End of the range.
};
// Stats for the share.
struct ShareStats
{
int64_t
ShareUsageBytes; // The approximate size of the data stored in bytes. Note that this value
// may not include all recently created or recently resized files.
int64_t ShareUsageBytes
= int64_t(); // The approximate size of the data stored in bytes. Note that this value may
// not include all recently created or recently resized files.
};
// Signed identifier.
@ -1238,7 +1240,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
}
else
{
throw Azure::Storage::StorageError::CreateFromResponse(context, std::move(responsePtr));
unused(context);
throw Azure::Storage::StorageError::CreateFromResponse(std::move(responsePtr));
}
}
@ -1333,7 +1336,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
}
else
{
throw Azure::Storage::StorageError::CreateFromResponse(context, std::move(responsePtr));
unused(context);
throw Azure::Storage::StorageError::CreateFromResponse(std::move(responsePtr));
}
}
@ -1682,7 +1686,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
}
else
{
throw Azure::Storage::StorageError::CreateFromResponse(context, std::move(responsePtr));
unused(context);
throw Azure::Storage::StorageError::CreateFromResponse(std::move(responsePtr));
}
}
@ -2546,7 +2551,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
}
else
{
throw Azure::Storage::StorageError::CreateFromResponse(context, std::move(responsePtr));
unused(context);
throw Azure::Storage::StorageError::CreateFromResponse(std::move(responsePtr));
}
}
@ -2599,7 +2605,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
}
else
{
throw Azure::Storage::StorageError::CreateFromResponse(context, std::move(responsePtr));
unused(context);
throw Azure::Storage::StorageError::CreateFromResponse(std::move(responsePtr));
}
}
@ -2617,7 +2624,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
}
else
{
throw Azure::Storage::StorageError::CreateFromResponse(context, std::move(responsePtr));
unused(context);
throw Azure::Storage::StorageError::CreateFromResponse(std::move(responsePtr));
}
}
@ -2638,7 +2646,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
}
else
{
throw Azure::Storage::StorageError::CreateFromResponse(context, std::move(responsePtr));
unused(context);
throw Azure::Storage::StorageError::CreateFromResponse(std::move(responsePtr));
}
}
@ -2657,7 +2666,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
}
else
{
throw Azure::Storage::StorageError::CreateFromResponse(context, std::move(responsePtr));
unused(context);
throw Azure::Storage::StorageError::CreateFromResponse(std::move(responsePtr));
}
}
@ -2684,7 +2694,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
}
else
{
throw Azure::Storage::StorageError::CreateFromResponse(context, std::move(responsePtr));
unused(context);
throw Azure::Storage::StorageError::CreateFromResponse(std::move(responsePtr));
}
}
@ -2719,7 +2730,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
}
else
{
throw Azure::Storage::StorageError::CreateFromResponse(context, std::move(responsePtr));
unused(context);
throw Azure::Storage::StorageError::CreateFromResponse(std::move(responsePtr));
}
}
@ -2739,7 +2751,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
}
else
{
throw Azure::Storage::StorageError::CreateFromResponse(context, std::move(responsePtr));
unused(context);
throw Azure::Storage::StorageError::CreateFromResponse(std::move(responsePtr));
}
}
@ -2764,7 +2777,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
}
else
{
throw Azure::Storage::StorageError::CreateFromResponse(context, std::move(responsePtr));
unused(context);
throw Azure::Storage::StorageError::CreateFromResponse(std::move(responsePtr));
}
}
@ -2982,7 +2996,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
}
else
{
throw Azure::Storage::StorageError::CreateFromResponse(context, std::move(responsePtr));
unused(context);
throw Azure::Storage::StorageError::CreateFromResponse(std::move(responsePtr));
}
}
@ -3043,7 +3058,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
}
else
{
throw Azure::Storage::StorageError::CreateFromResponse(context, std::move(responsePtr));
unused(context);
throw Azure::Storage::StorageError::CreateFromResponse(std::move(responsePtr));
}
}
@ -3127,7 +3143,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
}
else
{
throw Azure::Storage::StorageError::CreateFromResponse(context, std::move(responsePtr));
unused(context);
throw Azure::Storage::StorageError::CreateFromResponse(std::move(responsePtr));
}
}
};
@ -3580,7 +3597,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
}
else
{
throw Azure::Storage::StorageError::CreateFromResponse(context, std::move(responsePtr));
unused(context);
throw Azure::Storage::StorageError::CreateFromResponse(std::move(responsePtr));
}
}
@ -3617,7 +3635,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
}
else
{
throw Azure::Storage::StorageError::CreateFromResponse(context, std::move(responsePtr));
unused(context);
throw Azure::Storage::StorageError::CreateFromResponse(std::move(responsePtr));
}
}
@ -3635,7 +3654,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
}
else
{
throw Azure::Storage::StorageError::CreateFromResponse(context, std::move(responsePtr));
unused(context);
throw Azure::Storage::StorageError::CreateFromResponse(std::move(responsePtr));
}
}
@ -3664,7 +3684,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
}
else
{
throw Azure::Storage::StorageError::CreateFromResponse(context, std::move(responsePtr));
unused(context);
throw Azure::Storage::StorageError::CreateFromResponse(std::move(responsePtr));
}
}
@ -3685,7 +3706,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
}
else
{
throw Azure::Storage::StorageError::CreateFromResponse(context, std::move(responsePtr));
unused(context);
throw Azure::Storage::StorageError::CreateFromResponse(std::move(responsePtr));
}
}
@ -3711,7 +3733,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
}
else
{
throw Azure::Storage::StorageError::CreateFromResponse(context, std::move(responsePtr));
unused(context);
throw Azure::Storage::StorageError::CreateFromResponse(std::move(responsePtr));
}
}
@ -4108,7 +4131,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
}
else
{
throw Azure::Storage::StorageError::CreateFromResponse(context, std::move(responsePtr));
unused(context);
throw Azure::Storage::StorageError::CreateFromResponse(std::move(responsePtr));
}
}
@ -4327,7 +4351,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
}
else
{
throw Azure::Storage::StorageError::CreateFromResponse(context, std::move(responsePtr));
unused(context);
throw Azure::Storage::StorageError::CreateFromResponse(std::move(responsePtr));
}
}
};
@ -5473,7 +5498,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
}
else
{
throw Azure::Storage::StorageError::CreateFromResponse(context, std::move(responsePtr));
unused(context);
throw Azure::Storage::StorageError::CreateFromResponse(std::move(responsePtr));
}
}
@ -5732,7 +5758,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
}
else
{
throw Azure::Storage::StorageError::CreateFromResponse(context, std::move(responsePtr));
unused(context);
throw Azure::Storage::StorageError::CreateFromResponse(std::move(responsePtr));
}
}
@ -5860,7 +5887,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
}
else
{
throw Azure::Storage::StorageError::CreateFromResponse(context, std::move(responsePtr));
unused(context);
throw Azure::Storage::StorageError::CreateFromResponse(std::move(responsePtr));
}
}
@ -5877,7 +5905,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
}
else
{
throw Azure::Storage::StorageError::CreateFromResponse(context, std::move(responsePtr));
unused(context);
throw Azure::Storage::StorageError::CreateFromResponse(std::move(responsePtr));
}
}
@ -5906,7 +5935,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
}
else
{
throw Azure::Storage::StorageError::CreateFromResponse(context, std::move(responsePtr));
unused(context);
throw Azure::Storage::StorageError::CreateFromResponse(std::move(responsePtr));
}
}
@ -5927,7 +5957,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
}
else
{
throw Azure::Storage::StorageError::CreateFromResponse(context, std::move(responsePtr));
unused(context);
throw Azure::Storage::StorageError::CreateFromResponse(std::move(responsePtr));
}
}
@ -5948,7 +5979,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
}
else
{
throw Azure::Storage::StorageError::CreateFromResponse(context, std::move(responsePtr));
unused(context);
throw Azure::Storage::StorageError::CreateFromResponse(std::move(responsePtr));
}
}
@ -5968,7 +6000,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
}
else
{
throw Azure::Storage::StorageError::CreateFromResponse(context, std::move(responsePtr));
unused(context);
throw Azure::Storage::StorageError::CreateFromResponse(std::move(responsePtr));
}
}
@ -5989,7 +6022,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
}
else
{
throw Azure::Storage::StorageError::CreateFromResponse(context, std::move(responsePtr));
unused(context);
throw Azure::Storage::StorageError::CreateFromResponse(std::move(responsePtr));
}
}
@ -6013,7 +6047,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
}
else
{
throw Azure::Storage::StorageError::CreateFromResponse(context, std::move(responsePtr));
unused(context);
throw Azure::Storage::StorageError::CreateFromResponse(std::move(responsePtr));
}
}
@ -6040,7 +6075,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
}
else
{
throw Azure::Storage::StorageError::CreateFromResponse(context, std::move(responsePtr));
unused(context);
throw Azure::Storage::StorageError::CreateFromResponse(std::move(responsePtr));
}
}
@ -6063,7 +6099,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
}
else
{
throw Azure::Storage::StorageError::CreateFromResponse(context, std::move(responsePtr));
unused(context);
throw Azure::Storage::StorageError::CreateFromResponse(std::move(responsePtr));
}
}
@ -6090,7 +6127,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
}
else
{
throw Azure::Storage::StorageError::CreateFromResponse(context, std::move(responsePtr));
unused(context);
throw Azure::Storage::StorageError::CreateFromResponse(std::move(responsePtr));
}
}
@ -6246,7 +6284,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
}
else
{
throw Azure::Storage::StorageError::CreateFromResponse(context, std::move(responsePtr));
unused(context);
throw Azure::Storage::StorageError::CreateFromResponse(std::move(responsePtr));
}
}
@ -6264,7 +6303,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
}
else
{
throw Azure::Storage::StorageError::CreateFromResponse(context, std::move(responsePtr));
unused(context);
throw Azure::Storage::StorageError::CreateFromResponse(std::move(responsePtr));
}
}
@ -6288,7 +6328,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
}
else
{
throw Azure::Storage::StorageError::CreateFromResponse(context, std::move(responsePtr));
unused(context);
throw Azure::Storage::StorageError::CreateFromResponse(std::move(responsePtr));
}
}
@ -6507,7 +6548,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
}
else
{
throw Azure::Storage::StorageError::CreateFromResponse(context, std::move(responsePtr));
unused(context);
throw Azure::Storage::StorageError::CreateFromResponse(std::move(responsePtr));
}
}
};

View File

@ -13,10 +13,8 @@
namespace Azure { namespace Storage {
StorageError StorageError::CreateFromResponse(
Azure::Core::Context context,
std::unique_ptr<Azure::Core::Http::RawResponse> response)
{
unused(context);
std::vector<uint8_t> bodyBuffer = std::move(response->GetBody());
auto httpStatusCode = response->GetStatusCode();