/
storage_exception.hpp
42 lines (35 loc) · 1.14 KB
/
storage_exception.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Copyright (c) Microsoft Corporation. All rights reserved.
// SPDX-License-Identifier: MIT
#pragma once
#include <azure/core/exception.hpp>
#include <azure/core/http/http.hpp>
#include <map>
#include <memory>
#include <stdexcept>
#include <string>
namespace Azure { namespace Storage {
/**
* @brief An exception thrown when storage service request fails.
*/
struct StorageException final : public Azure::Core::RequestFailedException
{
/**
* @brief Constructs a #StorageException with a message.
*
* @param what The explanatory string.
*/
explicit StorageException(const std::string& what) : RequestFailedException(what) {}
/**
* Some storage-specific information in response body.
*/
std::map<std::string, std::string> AdditionalInformation;
/**
* @brief Constructs a #StorageException from a failed storage service response.
*
* @param response Raw HTTP response from storage service.
* @return #StorageException.
*/
static StorageException CreateFromResponse(
std::unique_ptr<Azure::Core::Http::RawResponse> response);
};
}} // namespace Azure::Storage