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);
57 ErrorWithStatus(std::string_view call_name, grpc::Status&& status,
58 std::optional<google::rpc::Status>&& gstatus,
59 std::optional<std::string>&& message);
61 const grpc::Status& GetStatus()
const noexcept;
63 const std::optional<google::rpc::Status>& GetGStatus()
const noexcept;
65 const std::optional<std::string>& GetGStatusString()
const noexcept;
69 std::optional<google::rpc::Status> gstatus_;
70 std::optional<std::string> gstatus_string_;
159[[noreturn]]
void ThrowErrorWithStatus(
160 std::string_view call_name, grpc::Status&& status,
161 std::optional<google::rpc::Status>&& gstatus,
162 std::optional<std::string>&& gstatus_string);