#include <status.h>
Public Member Functions | |
StatusCode | error_code () const |
Return the instance's error code. More... | |
std::string | error_details () const |
Return the (binary) error details. More... | |
std::string | error_message () const |
Return the instance's error message. More... | |
void | IgnoreError () const |
bool | ok () const |
Is the status OK? More... | |
Status () | |
Construct an OK instance. More... | |
Status (StatusCode code, const std::string &error_message) | |
Status (StatusCode code, const std::string &error_message, const std::string &error_details) | |
Static Public Attributes | |
static const Status & | CANCELLED = Status(StatusCode::CANCELLED, "") |
A CANCELLED pre-defined instance. More... | |
static const Status & | OK = Status() |
An OK pre-defined instance. More... | |
Private Attributes | |
std::string | binary_error_details_ |
StatusCode | code_ |
std::string | error_message_ |
Did it work? If it didn't, why?
See grpc::StatusCode for details on the available code and their meaning.
Describes the status of an RPC. This is an EXPERIMENTAL API. Attributes: code: A StatusCode object to be sent to the client. details: A UTF-8-encodable string to be sent to the client upon termination of the RPC. trailing_metadata: The trailing :term:`metadata` in the RPC.
Definition at line 35 of file include/grpcpp/impl/codegen/status.h.
|
inline |
Construct an OK instance.
Definition at line 38 of file include/grpcpp/impl/codegen/status.h.
|
inline |
Construct an instance with associated code and error_message. It is an error to construct an OK status with non-empty error_message. Note that message is intentionally accepted as a const reference instead of a value (which results in a copy instead of a move) to allow for easy transition to absl::Status in the future which accepts an absl::string_view as a parameter.
Definition at line 99 of file include/grpcpp/impl/codegen/status.h.
|
inline |
Construct an instance with code, error_message and error_details. It is an error to construct an OK status with non-empty error_message and/or error_details.
Definition at line 105 of file include/grpcpp/impl/codegen/status.h.
|
inline |
Return the instance's error code.
Definition at line 118 of file include/grpcpp/impl/codegen/status.h.
|
inline |
Return the (binary) error details.
Definition at line 123 of file include/grpcpp/impl/codegen/status.h.
|
inline |
Return the instance's error message.
Definition at line 120 of file include/grpcpp/impl/codegen/status.h.
|
inline |
Definition at line 131 of file include/grpcpp/impl/codegen/status.h.
|
inline |
Is the status OK?
Definition at line 126 of file include/grpcpp/impl/codegen/status.h.
|
private |
Definition at line 136 of file include/grpcpp/impl/codegen/status.h.
A CANCELLED pre-defined instance.
Definition at line 115 of file include/grpcpp/impl/codegen/status.h.
|
private |
Definition at line 134 of file include/grpcpp/impl/codegen/status.h.
|
private |
Definition at line 135 of file include/grpcpp/impl/codegen/status.h.
An OK pre-defined instance.
Definition at line 113 of file include/grpcpp/impl/codegen/status.h.