userver
C++ Async Framework
Toggle main menu visibility
Documentation
API Groups
Namespaces
Reference
Class List
Class Index
File List
Macros
All
e
i
l
r
t
u
Functions
Macros
e
i
l
r
t
u
Examples
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
Concepts
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
#
include
<
string
>
11
12
USERVER_NAMESPACE_BEGIN
13
14
namespace
formats
::
bson
{
15
16
/// Generic BSON-related exception
17
class
BsonException
:
public
utils
::
TracefulException
{
18
public
:
19
BsonException(std::string msg);
20
21
std::string_view GetMessage()
const
noexcept
{
return
msg_; }
22
23
private
:
24
std::string msg_;
25
};
17
class
BsonException
:
public
utils
::
TracefulException
{
…
};
26
27
/// BSON parsing error
28
class
ParseException
:
public
BsonException
{
29
public
:
30
using
BsonException
::BsonException;
31
};
28
class
ParseException
:
public
BsonException
{
…
};
32
33
class
ExceptionWithPath
:
public
BsonException
{
34
public
:
35
explicit
ExceptionWithPath(std::string_view msg, std::string_view path);
36
37
std::string_view GetPath()
const
noexcept
;
38
std::string_view GetMessageWithoutPath()
const
noexcept
;
39
40
private
:
41
std::size_t path_size_;
42
};
33
class
ExceptionWithPath
:
public
BsonException
{
…
};
43
44
/// BSON types mismatch error
45
class
TypeMismatchException
:
public
ExceptionWithPath
{
46
public
:
47
TypeMismatchException(bson_type_t actual, bson_type_t expected, std::string_view path);
48
};
45
class
TypeMismatchException
:
public
ExceptionWithPath
{
…
};
49
50
/// BSON array indexing error
51
class
OutOfBoundsException
:
public
ExceptionWithPath
{
52
public
:
53
OutOfBoundsException(size_t index, size_t size, std::string_view path);
54
};
51
class
OutOfBoundsException
:
public
ExceptionWithPath
{
…
};
55
56
/// BSON nonexisting member access error
57
class
MemberMissingException
:
public
ExceptionWithPath
{
58
public
:
59
explicit
MemberMissingException(std::string_view path);
60
};
57
class
MemberMissingException
:
public
ExceptionWithPath
{
…
};
61
62
/// Conversion error
63
class
ConversionException
:
public
ExceptionWithPath
{
64
public
:
65
ConversionException(std::string_view msg, std::string_view path);
66
};
63
class
ConversionException
:
public
ExceptionWithPath
{
…
};
67
68
}
// namespace formats::bson
69
70
USERVER_NAMESPACE_END
userver
formats
bson
exception.hpp
Generated on Wed Apr 30 2025 15:58:48 for userver by
Doxygen
1.13.2