userver
C++ Async Framework
Loading...
Searching...
No Matches
exception.hpp
Go to the documentation of this file.
1
#
pragma
once
2
3
/// @file userver/formats/bson/exception.hpp
4
/// @brief BSON-specific exceptions
5
6
#
include
<
bson
/
bson
.
h
>
7
8
#
include
<
userver
/
utils
/
traceful_exception
.
hpp
>
9
10
USERVER_NAMESPACE_BEGIN
11
12
namespace
formats::
bson
{
13
14
/// Generic BSON-related exception
15
class
BsonException
:
public
utils
::
TracefulException
{
16
public
:
17
using
utils
::
TracefulException
::TracefulException;
18
};
19
20
/// BSON parsing error
21
class
ParseException
:
public
BsonException
{
22
public
:
23
using
BsonException
::BsonException;
24
};
25
26
/// BSON types mismatch error
27
class
TypeMismatchException
:
public
BsonException
{
28
public
:
29
TypeMismatchException(bson_type_t actual, bson_type_t expected,
30
std::string_view path);
31
};
32
33
/// BSON array indexing error
34
class
OutOfBoundsException
:
public
BsonException
{
35
public
:
36
OutOfBoundsException(size_t index, size_t size, std::string_view path);
37
};
38
39
/// BSON nonexisting member access error
40
class
MemberMissingException
:
public
BsonException
{
41
public
:
42
explicit
MemberMissingException(std::string_view path);
43
};
44
45
/// Conversion error
46
class
ConversionException
:
public
BsonException
{
47
public
:
48
using
BsonException
::BsonException;
49
};
50
51
}
// namespace formats::bson
52
53
USERVER_NAMESPACE_END
userver
formats
bson
exception.hpp
Generated on Wed Oct 4 2023 12:19:39 for userver by
Doxygen
1.9.8