11#include <google/rpc/status.pb.h>
12#include <grpcpp/support/status.h>
14USERVER_NAMESPACE_BEGIN
25 explicit BaseError(std::string message);
27 const char* what()
const noexcept override;
36 RpcError(std::string_view call_name, std::string_view additional_info);
42class RpcInterruptedError
final :
public RpcError {
44 RpcInterruptedError(std::string_view call_name, std::string_view stage);
48class RpcCancelledError
final :
public RpcError {
50 RpcCancelledError(std::string_view call_name, std::string_view stage);
58 std::string_view call_name,
59 grpc::Status&& status,
60 std::optional<google::rpc::Status>&& gstatus,
61 std::optional<std::string>&& message
64 const grpc::Status& GetStatus()
const noexcept;
66 const std::optional<google::rpc::Status>& GetGStatus()
const noexcept;
68 const std::optional<std::string>& GetGStatusString()
const noexcept;
72 std::optional<google::rpc::Status> gstatus_;
73 std::optional<std::string> gstatus_string_;
162[[noreturn]]
void ThrowErrorWithStatus(
163 std::string_view call_name,
164 grpc::Status&& status,
165 std::optional<google::rpc::Status>&& gstatus,
166 std::optional<std::string>&& gstatus_string