SDK  2.1.4 [async]
CloudBackend Software Development Kit - SDK API for C++
ItemDelegateErrors.h
1 #ifndef CBE__delegate__ItemDelegateErrors_h__
2 #define CBE__delegate__ItemDelegateErrors_h__
3 
4 #include "cbe/Types.h"
5 
6 #include "cbe/util/ErrorInfo.h"
7 #include "cbe/util/Exception.h"
8 #include "cbe/Filter.h"
9 #include "cbe/Item.h"
10 
11 #include <iosfwd>
12 #include <string>
13 
14 namespace cbe {
15  namespace util {
16 
17 struct Context;
18 
19  } // namespace util
20  namespace delegate {
21 
26 class LoadError {
27 public:
28  class Error {
29  public:
30  Filter filter{};
37  std::string reason{};
38  std::string message{};
39 
40  Error();
41  Error(Filter&& filter,
43  std::string&& reason,
44  std::string&& message);
45  }; // class LoadError::Error
46 
47  virtual ~LoadError() = 0;
48 
55  virtual void onLoadError(Error&& error, cbe::util::Context&& context) = 0;
56 
57  friend std::ostream& operator<<(std::ostream& os,
58  const LoadError::Error& error);
59 }; // struct LoadError
60 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
65 class JoinError {
66 public:
67  class Error {
68  public:
69  ErrorCode errorCode{};
70  std::string reason{};
71  std::string message{};
72 
73  Error();
74  Error(ErrorCode errorCode,
75  std::string&& reason,
76  std::string&& message);
77  }; // class JoinError::Error
78 
79  virtual ~JoinError() = 0;
80 
87  virtual void onJoinError(Error&& error, cbe::util::Context&& context) = 0;
88 
89  friend std::ostream& operator<<(std::ostream& os,
90  const JoinError::Error& error);
91 }; // class JoinError::Error
92 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
97 class ItemError {
98 public:
99  struct Error {
100  public:
101  Item container{cbe::DefaultCtor{}};
102  ItemType type{};
103  ErrorCode errorCode{};
104  std::string reason{};
105  std::string message{};
106 
107  Error();
108  Error(Item container,
109  ItemType type,
110  ErrorCode errorCode,
111  std::string&& reason,
112  std::string&& message);
113  }; // struct ItemError
114 
115  virtual ~ItemError() = 0;
124  virtual void onItemError(Error&& error, cbe::util::Context&& context) = 0;
125 
126  friend std::ostream& operator<<(std::ostream& os,
127  const ItemError::Error& error);
128 }; // class ItemItemError::Error
129 
130  } // namespace delegate
131 } // namespace cbe
132 
133 
134 #endif // #ifndef CBE__delegate__ItemDelegateErrors_h__
Use to select Item that meets specific criterias when doing a query.
Definition: Filter.h:40
A set made up of Container and Object.
Definition: Item.h:36
Definition: ItemDelegateErrors.h:97
virtual void onItemError(Error &&error, cbe::util::Context &&context)=0
Definition: ItemDelegateErrors.h:67
Definition: ItemDelegateErrors.h:65
virtual void onJoinError(Error &&error, cbe::util::Context &&context)=0
Definition: ItemDelegateErrors.h:28
ErrorCode errorCode
Definition: ItemDelegateErrors.h:36
Definition: ItemDelegateErrors.h:26
virtual void onLoadError(Error &&error, cbe::util::Context &&context)=0
Root namespace for the CloudBackend SDK API.
Definition: Account.h:22
std::uint32_t ErrorCode
Mimics the general error code encoding in the www.
Definition: Types.h:142
DefaultCtor
Default constructor marker.
Definition: Types.h:204
ItemType
Definition: Types.h:242
Definition: ItemDelegateErrors.h:99
Definition: Context.h:11