userver: error_injection::Hook Class Reference
Loading...
Searching...
No Matches
error_injection::Hook Class Referencefinal

#include <userver/error_injection/hook.hpp>

Detailed Description

Single operation error injection process. Create on the stack, call PreHook(), do operation, call PostHook().

Definition at line 16 of file hook.hpp.

Public Member Functions

 Hook (const Settings &settings, engine::Deadline deadline)
 
template<typename TimeoutException , typename ErrorException >
void PreHook ()
 
void PostHook ()
 

Member Function Documentation

◆ PostHook()

void error_injection::Hook::PostHook ( )
inline

Must be called just after operation. May sleep for some time, or do nothing.

Definition at line 55 of file hook.hpp.

◆ PreHook()

template<typename TimeoutException , typename ErrorException >
void error_injection::Hook::PreHook ( )
inline

Must be called just before actual operation. May sleep for some time, throw an exception, or do nothing.

Exceptions
TimeoutExceptionin case of artificial timeout
ErrorExceptionin case of artificial error

Definition at line 25 of file hook.hpp.


The documentation for this class was generated from the following file: