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/yaml/exception.hpp
4
/// @brief Exception classes for YAML module
5
/// @ingroup userver_universal
6
7
#
include
<
iosfwd
>
8
#
include
<
stdexcept
>
9
#
include
<
string
>
10
11
#
include
<
userver
/
formats
/
yaml
/
types
.
hpp
>
12
13
USERVER_NAMESPACE_BEGIN
14
15
namespace
formats
::
yaml
{
16
17
class
Exception
:
public
std::exception {
18
public
:
19
explicit
Exception(std::string msg) : msg_(std::move(msg)) {}
20
21
const
char
* what()
const
noexcept
final
{
return
msg_.c_str(); }
22
23
std::string_view GetMessage()
const
noexcept
{
return
msg_; }
24
25
private
:
26
std::string msg_;
27
};
17
class
Exception
:
public
std::exception {
…
};
28
29
class
ParseException
:
public
Exception
{
30
public
:
31
using
Exception
::Exception;
32
};
29
class
ParseException
:
public
Exception
{
…
};
33
34
class
ExceptionWithPath
:
public
Exception
{
35
public
:
36
explicit
ExceptionWithPath(std::string_view msg, std::string_view path);
37
38
std::string_view GetPath()
const
noexcept
;
39
std::string_view GetMessageWithoutPath()
const
noexcept
;
40
41
private
:
42
std::size_t path_size_;
43
};
34
class
ExceptionWithPath
:
public
Exception
{
…
};
44
45
class
BadStreamException
:
public
Exception
{
46
public
:
47
explicit
BadStreamException(
const
std::istream& is);
48
explicit
BadStreamException(
const
std::ostream& os);
49
};
45
class
BadStreamException
:
public
Exception
{
…
};
50
51
class
TypeMismatchException
:
public
ExceptionWithPath
{
52
public
:
53
TypeMismatchException(
Type
actual,
Type
expected, std::string_view path);
54
TypeMismatchException(
int
actual,
int
expected, std::string_view path);
55
TypeMismatchException(
const
YAML::Node& value, std::string_view expected_type, std::string_view path);
56
};
51
class
TypeMismatchException
:
public
ExceptionWithPath
{
…
};
57
58
class
OutOfBoundsException
:
public
ExceptionWithPath
{
59
public
:
60
OutOfBoundsException(size_t index, size_t size, std::string_view path);
61
};
58
class
OutOfBoundsException
:
public
ExceptionWithPath
{
…
};
62
63
class
MemberMissingException
:
public
ExceptionWithPath
{
64
public
:
65
explicit
MemberMissingException(std::string_view path);
66
};
63
class
MemberMissingException
:
public
ExceptionWithPath
{
…
};
67
68
class
PathPrefixException
:
public
Exception
{
69
public
:
70
explicit
PathPrefixException(std::string_view old_path, std::string_view prefix);
71
};
68
class
PathPrefixException
:
public
Exception
{
…
};
72
73
}
// namespace formats::yaml
74
75
USERVER_NAMESPACE_END
userver
formats
yaml
exception.hpp
Generated on Wed Apr 30 2025 15:48:43 for userver by
Doxygen
1.13.2