GRPC C++  1.66.0
Public Member Functions | Static Public Attributes
grpc::Status Class Reference

Did it work? If it didn't, why? More...

#include <status.h>

Public Member Functions

 Status ()
 Construct an OK instance. More...
 
 Status (StatusCode code, const std::string &error_message)
 Construct an instance with associated code and error_message. More...
 
 Status (StatusCode code, const std::string &error_message, const std::string &error_details)
 Construct an instance with code, error_message and error_details. More...
 
StatusCode error_code () const
 Return the instance's error code. More...
 
std::string error_message () const
 Return the instance's error message. More...
 
std::string error_details () const
 Return the (binary) error details. More...
 
bool ok () const
 Is the status OK? More...
 
void IgnoreError () const
 

Static Public Attributes

static const StatusOK
 An OK pre-defined instance. More...
 
static const StatusCANCELLED
 A CANCELLED pre-defined instance. More...
 

Detailed Description

Did it work? If it didn't, why?

See grpc::StatusCode for details on the available code and their meaning.

Constructor & Destructor Documentation

◆ Status() [1/3]

grpc::Status::Status ( )
inline

Construct an OK instance.

◆ Status() [2/3]

grpc::Status::Status ( StatusCode  code,
const std::string &  error_message 
)
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.

◆ Status() [3/3]

grpc::Status::Status ( StatusCode  code,
const std::string &  error_message,
const std::string &  error_details 
)
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.

Member Function Documentation

◆ error_code()

StatusCode grpc::Status::error_code ( ) const
inline

Return the instance's error code.

◆ error_details()

std::string grpc::Status::error_details ( ) const
inline

Return the (binary) error details.

◆ error_message()

std::string grpc::Status::error_message ( ) const
inline

Return the instance's error message.

◆ IgnoreError()

void grpc::Status::IgnoreError ( ) const
inline

◆ ok()

bool grpc::Status::ok ( ) const
inline

Is the status OK?

Field Documentation

◆ CANCELLED

const Status& grpc::Status::CANCELLED
static

A CANCELLED pre-defined instance.

◆ OK

const Status& grpc::Status::OK
static

An OK pre-defined instance.


The documentation for this class was generated from the following file: