6 #ifndef JBSON_ERROR_HPP
7 #define JBSON_ERROR_HPP
12 #include "./config.hpp"
14 JBSON_PUSH_DISABLE_DOCUMENTATION_WARNING
15 #include <boost/exception/all.hpp>
16 JBSON_CLANG_POP_WARNINGS
23 struct jbson_error :
virtual std::exception,
virtual boost::exception {
25 const char*
what() const noexcept
override {
return "jbson_error"; }
33 const char*
what() const noexcept
override {
return "invalid_element_type"; }
41 const char*
what() const noexcept
override {
return "incompatible_element_conversion"; }
49 const char*
what() const noexcept
override {
return "incompatible_type_conversion"; }
57 const char*
what() const noexcept
override {
return "invalid_element_size"; }
64 using expected_type = boost::error_info<struct expected_type_, std::type_index>;
65 using actual_type = boost::error_info<struct actual_type_, std::type_index>;
66 using expected_size = boost::error_info<struct expected_size_, ptrdiff_t>;
67 using actual_size = boost::error_info<struct actual_size_, ptrdiff_t>;
68 using expected_element_type = boost::error_info<struct expected_element_type_, element_type>;
69 using actual_element_type = boost::error_info<struct actual_element_type_, element_type>;
74 #endif // JBSON_ERROR_HPP
element_type
The element_type enum represents a BSON data type.
const char * what() const noexceptoverride
Returns name of exception.
const char * what() const noexceptoverride
Returns name of exception.
const char * what() const noexceptoverride
Returns name of exception.
Exception thrown when an element has a value not convertible to that requested.
const char * what() const noexceptoverride
Returns name of exception.
const char * what() const noexceptoverride
Returns name of exception.
Exception type. Base class of all exceptions thrown directly by jbson.
Exception thrown when an element's data size differs from that reported.
Exception type thrown when a call to get() has an incorrect type parameter.
Exception type thrown when an element has a type value not represented by element_type.