userver
C++ Async Framework
Toggle main menu visibility
Loading...
Searching...
No Matches
exceptions.hpp
Go to the documentation of this file.
1
#pragma once
2
5
6
#include <exception>
7
#include <string>
8
#include <string_view>
9
10
#include <grpcpp/support/status.h>
11
#include <grpcpp/support/status_code_enum.h>
12
13
USERVER_NAMESPACE_BEGIN
14
16
namespace
ugrpc::server
{
17
19
class
BaseError :
public
std::exception {
20
public
:
21
explicit
BaseError(std::string message);
22
23
const
char
* what()
const
noexcept
override
;
24
25
private
:
26
std::string message_;
27
};
28
30
class
RpcError :
public
BaseError {
31
public
:
32
RpcError(std::string_view call_name, std::string_view additional_info);
33
};
34
38
class
RpcInterruptedError :
public
RpcError {
39
public
:
40
RpcInterruptedError(std::string_view call_name, std::string_view stage);
41
};
42
45
class
ErrorWithStatus :
public
BaseError {
46
public
:
47
explicit
ErrorWithStatus(grpc::Status status);
48
49
ErrorWithStatus(grpc::StatusCode status_code, std::string message);
50
51
const
grpc::Status& GetStatus()
const
;
52
53
grpc::Status&& ExtractStatus();
54
55
private
:
56
grpc::Status status_;
57
};
58
59
}
// namespace ugrpc::server
60
61
USERVER_NAMESPACE_END
userver
ugrpc
server
exceptions.hpp
Generated on
for userver by
Doxygen
1.17.0