diff options
author | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2017-05-11 23:24:37 +0200 |
---|---|---|
committer | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2017-05-11 23:24:37 +0200 |
commit | eb36b8ac7700d43ec9dadfffbfa83d0540cbdb27 (patch) | |
tree | 24f8d3bd3640dd95a470c52bd718fc8fcb5b087c /include/grpc++/impl/codegen/status.h | |
parent | 0444d98f17c7e742be1463e5714a24cd2eb6f99e (diff) | |
parent | 45b89fb11ca3cd524787aeba7a1270f744a1256c (diff) |
Merge branch 'master' of https://github.com/grpc/grpc into import
Diffstat (limited to 'include/grpc++/impl/codegen/status.h')
-rw-r--r-- | include/grpc++/impl/codegen/status.h | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/include/grpc++/impl/codegen/status.h b/include/grpc++/impl/codegen/status.h index a509d311d4..31fd6cdbe7 100644 --- a/include/grpc++/impl/codegen/status.h +++ b/include/grpc++/impl/codegen/status.h @@ -47,10 +47,16 @@ class Status { /// Construct an OK instance. Status() : code_(StatusCode::OK) {} - /// Construct an instance with associated \a code and \a details (also - // referred to as "error_message"). - Status(StatusCode code, const grpc::string& details) - : code_(code), details_(details) {} + /// Construct an instance with associated \a code and \a error_message + Status(StatusCode code, const grpc::string& error_message) + : code_(code), error_message_(error_message) {} + + /// Construct an instance with \a code, \a error_message and \a error_details + Status(StatusCode code, const grpc::string& error_message, + const grpc::string& error_details) + : code_(code), + error_message_(error_message), + binary_error_details_(error_details) {} // Pre-defined special status objects. /// An OK pre-defined instance. @@ -61,14 +67,18 @@ class Status { /// Return the instance's error code. StatusCode error_code() const { return code_; } /// Return the instance's error message. - grpc::string error_message() const { return details_; } + grpc::string error_message() const { return error_message_; } + /// Return the (binary) error details. + // Usually it contains a serialized google.rpc.Status proto. + grpc::string error_details() const { return binary_error_details_; } /// Is the status OK? bool ok() const { return code_ == StatusCode::OK; } private: StatusCode code_; - grpc::string details_; + grpc::string error_message_; + grpc::string binary_error_details_; }; } // namespace grpc |