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/json/parser/exception.hpp
4
/// @brief Exception types for JSON streaming parsers.
5
/// @ingroup userver_universal
6
7
#
include
<
stdexcept
>
8
9
#
include
<
fmt
/
format
.
h
>
10
11
#
include
<
userver
/
formats
/
json
/
exception
.
hpp
>
12
13
USERVER_NAMESPACE_BEGIN
14
15
namespace
formats::json::
parser
{
16
17
class
BaseError
:
public
formats::json::
Exception
{
18
public
:
19
using
Exception
::Exception;
20
21
BaseError(
const
BaseError
&) =
default
;
22
BaseError(
BaseError
&&) =
default
;
23
BaseError
& operator=(
const
BaseError
&) =
default
;
24
BaseError
& operator=(
BaseError
&&) =
default
;
25
26
~BaseError() override;
27
};
28
29
class
ParseError
:
public
BaseError
{
30
public
:
31
ParseError(size_t pos, std::string_view path, std::string what)
32
:
BaseError
(fmt::format(
"Parse error at pos {}, path '{}': {}"
, pos, path, what))
33
{}
34
35
ParseError(
const
ParseError
&) =
default
;
36
ParseError(
ParseError
&&) =
default
;
37
ParseError
& operator=(
const
ParseError
&) =
default
;
38
ParseError
& operator=(
ParseError
&&) =
default
;
39
40
~ParseError() override;
41
};
42
43
class
InternalParseError
:
public
BaseError
{
44
public
:
45
using
BaseError
::BaseError;
46
47
InternalParseError(
const
InternalParseError
&) =
default
;
48
InternalParseError(
InternalParseError
&&) =
default
;
49
InternalParseError
& operator=(
const
InternalParseError
&) =
default
;
50
InternalParseError
& operator=(
InternalParseError
&&) =
default
;
51
52
~InternalParseError() override;
53
};
54
55
}
// namespace formats::json::parser
56
57
USERVER_NAMESPACE_END
userver
formats
json
parser
exception.hpp
Generated on Thu May 21 2026 16:22:13 for userver by
Doxygen
1.13.2