5 #ifndef TABLEAU_HYPER_HYPEREXCEPTION_HPP
6 #define TABLEAU_HYPER_HYPEREXCEPTION_HPP
8 #include <hyperapi/impl/infra.hpp>
10 #include <hyperapi/hyperapi.h>
15 #include <system_error>
28 constexpr
explicit ContextId(uint32_t value) noexcept
31 constexpr uint32_t getValue()
const noexcept {
return value; }
55 const char*
getMainMessage() const noexcept {
return getStringField(HYPER_ERROR_FIELD_MESSAGE); }
60 const char*
getHint() const noexcept {
return getStringField(HYPER_ERROR_FIELD_HINT_MESSAGE); }
67 HYPER_DEPRECATED(
"Use getMainMessage() instead. This function will be removed in the future.")
78 HYPER_DEPRECATED(
"Use getHint() instead. This function will be removed in the future.")
89 HYPER_DEPRECATED(
"Use getCause().has_value() instead. This function will be removed in the future.")
90 bool hasCause() const noexcept {
return (getCauseHandle() !=
nullptr); }
110 const char*
what() const noexcept override;
129 explicit
HyperException(hyper_error_t* error, std::shared_ptr<const hyper_error_t> top_level_error);
136 const
char* getStringField(hyper_error_field_key key) const noexcept;
143 int getIntField(hyper_error_field_key key) const noexcept;
150 uint32_t getUIntField(hyper_error_field_key key) const noexcept;
155 hyper_error_t* getCauseHandle() const noexcept;
158 std::shared_ptr<const hyper_error_t> m_error;
161 mutable std::
string stringRepresentation;
170 friend
HyperException internal::makeHyperException(hyper_error_t*);
171 friend class HyperExceptionTest;
175 #include <hyperapi/impl/HyperException.impl.hpp>