userver
C++ Async Framework (beta)
Loading...
Searching...
No Matches
userver
error_injection
settings.hpp
1
#
pragma
once
2
3
#
include
<
memory
>
4
#
include
<
string
>
5
#
include
<
vector
>
6
7
#
include
<
userver
/
yaml_config
/
yaml_config
.
hpp
>
8
9
USERVER_NAMESPACE_BEGIN
10
11
namespace
error_injection
{
12
13
/// What error injection hook may decide to do
14
enum
class
Verdict
{
15
Error
,
///< return error
16
Timeout
,
///< wait for deadline and return error
17
MaxDelay
,
///< wait for deadline w/o returning an error
18
RandomDelay
,
///< wait for [0; deadline] w/o retunring an error
19
20
// Skip must be the last
21
22
Skip
,
///< no error
23
};
24
25
struct
Settings
final
{
26
bool
enabled{
false
};
27
double
probability{0};
28
std::vector<Verdict> possible_verdicts;
29
};
30
31
Settings Parse(
const
yaml_config
::
YamlConfig
& value,
32
formats::
parse
::
To
<Settings>);
33
34
}
// namespace error_injection
35
36
USERVER_NAMESPACE_END
Generated on Thu Jan 26 2023 18:56:59 for userver by
Doxygen
1.9.5