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
exceptions.hpp
1
#
pragma
once
2
3
#
include
<
cstdint
>
4
#
include
<
stdexcept
>
5
#
include
<
string_view
>
6
7
USERVER_NAMESPACE_BEGIN
8
9
namespace
kafka {
10
11
/// @brief Base exception thrown by Producer::Send and Producer::SendAsync
12
/// on send or delivery errors.
13
class
SendException
:
public
std::runtime_error {
14
public
:
15
using
std::runtime_error::runtime_error;
16
17
/// @brief Returns whether it makes sense to retry failed send.
18
///
19
/// @see
20
/// https://docs.confluent.io/platform/current/clients/librdkafka/html/md_INTRODUCTION.html#autotoc_md8
21
bool
IsRetryable
()
const
noexcept
;
22
23
protected
:
24
SendException(
const
char
* what,
bool
is_retryable);
25
26
private
:
27
const
bool
is_retryable_{
false
};
28
};
13
class
SendException
:
public
std::runtime_error {
…
};
29
30
class
DeliveryTimeoutException
final
:
public
SendException
{
31
static
constexpr
const
char
* kWhat{
32
"Message is not delivered after `delivery_timeout` milliseconds. Hint: "
33
"Adjust `delivery_timeout` and `queue_buffering_*` options or manually "
34
"retry the send request."
};
35
36
public
:
37
DeliveryTimeoutException();
38
};
30
class
DeliveryTimeoutException
final
:
public
SendException
{
…
};
39
40
class
QueueFullException
final
:
public
SendException
{
41
static
constexpr
const
char
* kWhat{
42
"The sending queue is full - send request cannot be scheduled. Hint: "
43
"Manually retry the error or increase `queue_buffering_max_messages` "
44
"and/or `queue_buffering_max_kbytes` config option."
};
45
46
public
:
47
QueueFullException();
48
};
40
class
QueueFullException
final
:
public
SendException
{
…
};
49
50
class
MessageTooLargeException
final
:
public
SendException
{
51
static
constexpr
const
char
* kWhat{
52
"Message size exceeds configured limit. Hint: increase "
53
"`message_max_bytes` config option."
};
54
55
public
:
56
MessageTooLargeException();
57
};
50
class
MessageTooLargeException
final
:
public
SendException
{
…
};
58
59
class
UnknownTopicException
final
:
public
SendException
{
60
static
constexpr
const
char
* kWhat{
"Given topic does not exist in cluster."
};
61
62
public
:
63
UnknownTopicException();
64
};
59
class
UnknownTopicException
final
:
public
SendException
{
…
};
65
66
class
UnknownPartitionException
final
:
public
SendException
{
67
static
constexpr
const
char
* kWhat =
"Topic does not have given partition."
;
68
69
public
:
70
UnknownPartitionException();
71
};
66
class
UnknownPartitionException
final
:
public
SendException
{
…
};
72
73
/// @brief Exception thrown when there is an error retrieving the offset range.
74
class
OffsetRangeException
:
public
std::runtime_error {
75
public
:
76
using
std::runtime_error::runtime_error;
77
78
public
:
79
OffsetRangeException(std::string_view what, std::string_view topic, std::uint32_t partition);
80
};
74
class
OffsetRangeException
:
public
std::runtime_error {
…
};
81
82
class
OffsetRangeTimeoutException
final
:
public
OffsetRangeException
{
83
static
constexpr
const
char
* kWhat =
"Timeout while fetching offsets."
;
84
85
public
:
86
OffsetRangeTimeoutException(std::string_view topic, std::uint32_t partition);
87
};
82
class
OffsetRangeTimeoutException
final
:
public
OffsetRangeException
{
…
};
88
89
class
TopicNotFoundException
final
:
public
std::runtime_error {
90
public
:
91
using
std::runtime_error::runtime_error;
92
};
89
class
TopicNotFoundException
final
:
public
std::runtime_error {
…
};
93
94
/// @brief Exception thrown when fetching metadata.
95
class
GetMetadataException
:
public
std::runtime_error {
96
public
:
97
using
std::runtime_error::runtime_error;
98
99
public
:
100
GetMetadataException(std::string_view what, std::string_view topic);
101
};
95
class
GetMetadataException
:
public
std::runtime_error {
…
};
102
103
class
GetMetadataTimeoutException
final
:
public
GetMetadataException
{
104
static
constexpr
const
char
* kWhat =
"Timeout while getting metadata."
;
105
106
public
:
107
GetMetadataTimeoutException(std::string_view topic);
108
};
103
class
GetMetadataTimeoutException
final
:
public
GetMetadataException
{
…
};
109
110
/// @brief Exception throw when parsing consumed messages headers.
111
/// @see Message::GetHeaders
112
class
ParseHeadersException
final
: std::runtime_error {
113
static
constexpr
const
char
* kWhat =
"Failed to parse headers"
;
114
115
public
:
116
ParseHeadersException(std::string_view error);
117
};
112
class
ParseHeadersException
final
: std::runtime_error {
…
};
118
119
}
// namespace kafka
120
121
USERVER_NAMESPACE_END
Docs version:
v1.0
,
v2.0
,
trunk/develop
userver
kafka
exceptions.hpp
Generated on Wed Apr 30 2025 15:50:29 for userver by
Doxygen
1.13.2