userver
C++ Async Framework
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
Toggle main menu visibility
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
Concepts
Loading...
Searching...
No Matches
All results
exception.hpp
Go to the documentation of this file.
1
#
pragma
once
2
3
/// @file userver/formats/json/exception.hpp
4
/// @brief Exception classes for JSON module
5
/// @ingroup userver_universal
6
7
#
include
<
iosfwd
>
8
#
include
<
stdexcept
>
9
#
include
<
string
>
10
#
include
<
string_view
>
11
12
USERVER_NAMESPACE_BEGIN
13
14
namespace
formats
::
json
{
15
16
class
Exception
:
public
std::exception {
17
public
:
18
explicit
Exception(std::string msg) : msg_(std::move(msg)) {}
19
20
const
char
* what()
const
noexcept
final
{
return
msg_.c_str(); }
21
22
std::string_view GetMessage()
const
noexcept
{
return
msg_; }
23
24
private
:
25
std::string msg_;
26
};
16
class
Exception
:
public
std::exception {
…
};
27
28
class
ParseException
:
public
Exception
{
29
public
:
30
using
Exception
::Exception;
31
};
28
class
ParseException
:
public
Exception
{
…
};
32
33
class
ExceptionWithPath
:
public
Exception
{
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
Exception
{
…
};
43
44
class
BadStreamException
:
public
Exception
{
45
public
:
46
explicit
BadStreamException(
const
std::istream& is);
47
explicit
BadStreamException(
const
std::ostream& os);
48
};
44
class
BadStreamException
:
public
Exception
{
…
};
49
50
class
TypeMismatchException
:
public
ExceptionWithPath
{
51
public
:
52
TypeMismatchException(
int
actual,
int
expected, std::string_view path);
53
std::string_view GetActual()
const
;
54
std::string_view GetExpected()
const
;
55
56
private
:
57
int
actual_;
58
int
expected_;
59
};
50
class
TypeMismatchException
:
public
ExceptionWithPath
{
…
};
60
61
class
OutOfBoundsException
:
public
ExceptionWithPath
{
62
public
:
63
OutOfBoundsException(size_t index, size_t size, std::string_view path);
64
};
61
class
OutOfBoundsException
:
public
ExceptionWithPath
{
…
};
65
66
class
MemberMissingException
:
public
ExceptionWithPath
{
67
public
:
68
explicit
MemberMissingException(std::string_view path);
69
};
66
class
MemberMissingException
:
public
ExceptionWithPath
{
…
};
70
71
/// Conversion error
72
class
ConversionException
:
public
ExceptionWithPath
{
73
public
:
74
ConversionException(std::string_view msg, std::string_view path);
75
};
72
class
ConversionException
:
public
ExceptionWithPath
{
…
};
76
77
class
UnknownDiscriminatorException
:
public
ExceptionWithPath
{
78
public
:
79
UnknownDiscriminatorException(std::string_view path, std::string_view discriminator_field);
80
};
77
class
UnknownDiscriminatorException
:
public
ExceptionWithPath
{
…
};
81
82
}
// namespace formats::json
83
84
USERVER_NAMESPACE_END
Docs version:
v1.0
,
v2.0
,
trunk/develop
userver
formats
json
exception.hpp
Generated on Wed Apr 30 2025 15:48:43 for userver by
Doxygen
1.13.2