82 default:
return "UNKNOWN";
gRPC protocol implementation
status_code
gRPC status codes (as defined in grpc/status.h)
@ cancelled
The operation was cancelled.
@ deadline_exceeded
Deadline expired before operation completed.
@ unimplemented
Operation not implemented.
@ ok
Not an error; returned on success.
@ out_of_range
Operation attempted past valid range.
@ unavailable
Service unavailable.
@ not_found
Some requested entity was not found.
@ already_exists
Entity already exists.
@ unauthenticated
Request lacks valid authentication.
@ data_loss
Unrecoverable data loss.
@ internal
Internal error.
@ failed_precondition
Operation rejected due to system state.
@ aborted
Operation aborted.
@ invalid_argument
Client specified an invalid argument.
@ permission_denied
Permission denied.
@ resource_exhausted
Resource exhausted.
constexpr auto status_code_to_string(status_code code) -> std::string_view
Convert status code to string.
gRPC status with code, message, and optional details
auto code_string() const -> std::string_view
Get status code as string.
std::optional< std::string > details
auto is_ok() const -> bool
Check if status is OK.
grpc_status(status_code c, std::string msg)
Construct with status code and message.
grpc_status()=default
Default constructor (OK status)
static auto ok_status() -> grpc_status
Create OK status.
grpc_status(status_code c, std::string msg, std::string det)
Construct with status code, message, and details.
static auto error_status(status_code c, std::string msg) -> grpc_status
Create error status.
auto is_error() const -> bool
Check if status represents an error.
grpc_status(status_code c)
Construct with status code.
gRPC trailing metadata containing status information
std::optional< std::string > status_details
std::string status_message
auto to_status() const -> grpc_status
Convert to grpc_status.