SDK  2.1.4 [async]
CloudBackend Software Development Kit - SDK API for C++
Exception.h
1 #ifndef CBE__util__Exception_h__
2 #define CBE__util__Exception_h__
3 
4 #include <stdexcept>
5 #include <string>
6 #include <type_traits>
7 namespace cbe {
8  namespace util {
9 
13 struct Exception : std::runtime_error {
14  template <typename... Ts>
15  Exception(Ts&&... args);
16  std::string typeAsString() const;
17 
25  template <class CbeExceptionT>
26  const CbeExceptionT* derivedCbeException() const {
27  static_assert(std::is_base_of<cbe::util::Exception, CbeExceptionT>::value,
28  "The provided exception type, CbeExceptionT, "
29  "is not a subclass of cbe::util::Exception");
30  return dynamic_cast<const CbeExceptionT*>(this);
31  }
32 };
33 
37 template <class ErrorInfoT>
39  ExceptionImpl(ErrorInfoT&& errorInfo);
40 
42 
43  const ErrorInfoT errorInfo;
44 };
45 
46  } // namespace util
47 } // namespace cbe
48 
49 
50 #endif // #ifndef CBE__util__Exception_h__
Root namespace for the CloudBackend SDK API.
Definition: Account.h:22
Definition: Exception.h:38
Definition: Exception.h:13
const CbeExceptionT * derivedCbeException() const
Examines whether current exception is of type CbeExceptionT.
Definition: Exception.h:26