AWS SDK for C++  1.8.50
AWS SDK for C++
AWSErrorMarshaller.h
Go to the documentation of this file.
1 
6 #pragma once
7 
10 
11 namespace Aws
12 {
13  namespace Http
14  {
15  class HttpResponse;
16  enum class HttpResponseCode;
17  }
18 
19  namespace Utils
20  {
21  namespace Xml
22  {
23  class XmlDocument;
24  }
25  namespace Json
26  {
27  class JsonValue;
28  }
29  }
30 
31  namespace Client
32  {
33  enum class CoreErrors;
34 
35  template<typename ERROR_TYPE>
36  class AWSError;
37 
42  {
43  public:
44  virtual ~AWSErrorMarshaller() {}
45 
50  virtual AWSError<CoreErrors> Marshall(const Aws::Http::HttpResponse& response) const = 0;
54  virtual AWSError<CoreErrors> FindErrorByName(const char* exceptionName) const;
55  virtual AWSError<CoreErrors> FindErrorByHttpResponseCode(Aws::Http::HttpResponseCode code) const;
59  virtual Aws::String ExtractRegion(const AWSError<CoreErrors>&) const { return {}; }
63  virtual Aws::String ExtractEndpoint(const AWSError<CoreErrors>&) const { return {}; }
64  protected:
65  AWSError<CoreErrors> Marshall(const Aws::String& exceptionName, const Aws::String& message) const;
66  };
67 
69  {
70  using AWSErrorMarshaller::Marshall;
71  public:
76  AWSError<CoreErrors> Marshall(const Aws::Http::HttpResponse& response) const override;
77 
78  protected:
79  const Aws::Utils::Json::JsonValue& GetJsonPayloadFromError(const AWSError<CoreErrors>&) const;
80  };
81 
83  {
84  using AWSErrorMarshaller::Marshall;
85  public:
90  AWSError<CoreErrors> Marshall(const Aws::Http::HttpResponse& response) const override;
91 
92  protected:
93  const Aws::Utils::Xml::XmlDocument& GetXmlPayloadFromError(const AWSError<CoreErrors>&) const;
94  };
95 
96  } // namespace Client
97 } // namespace Aws
virtual Aws::String ExtractRegion(const AWSError< CoreErrors > &) const
virtual Aws::String ExtractEndpoint(const AWSError< CoreErrors > &) const
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String
Definition: AWSString.h:97
#define AWS_CORE_API
Definition: Core_EXPORTS.h:25