|
|
|
@ -16,10 +16,10 @@ |
|
|
|
|
* |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
#ifndef GRPCPP_SUPPORT_ERROR_DETAILS_H |
|
|
|
|
#define GRPCPP_SUPPORT_ERROR_DETAILS_H |
|
|
|
|
#ifndef GRPCPP_SUPPORT_ERROR_DETAILS_IMPL_H |
|
|
|
|
#define GRPCPP_SUPPORT_ERROR_DETAILS_IMPL_H |
|
|
|
|
|
|
|
|
|
#include <grpcpp/support/error_details_impl.h> |
|
|
|
|
#include <grpcpp/support/status.h> |
|
|
|
|
|
|
|
|
|
namespace google { |
|
|
|
|
namespace rpc { |
|
|
|
@ -29,16 +29,20 @@ class Status; |
|
|
|
|
|
|
|
|
|
namespace grpc { |
|
|
|
|
|
|
|
|
|
static inline Status ExtractErrorDetails(const Status& from, |
|
|
|
|
::google::rpc::Status* to) { |
|
|
|
|
return ::grpc_impl::ExtractErrorDetails(from, to); |
|
|
|
|
} |
|
|
|
|
/// Map a \a grpc::Status to a \a google::rpc::Status.
|
|
|
|
|
/// The given \a to object will be cleared.
|
|
|
|
|
/// On success, returns status with OK.
|
|
|
|
|
/// Returns status with \a INVALID_ARGUMENT, if failed to deserialize.
|
|
|
|
|
/// Returns status with \a FAILED_PRECONDITION, if \a to is nullptr.
|
|
|
|
|
grpc::Status ExtractErrorDetails(const grpc::Status& from, |
|
|
|
|
::google::rpc::Status* to); |
|
|
|
|
|
|
|
|
|
static inline Status SetErrorDetails(const ::google::rpc::Status& from, |
|
|
|
|
Status* to) { |
|
|
|
|
return ::grpc_impl::SetErrorDetails(from, to); |
|
|
|
|
} |
|
|
|
|
/// Map \a google::rpc::Status to a \a grpc::Status.
|
|
|
|
|
/// Returns OK on success.
|
|
|
|
|
/// Returns status with \a FAILED_PRECONDITION if \a to is nullptr.
|
|
|
|
|
grpc::Status SetErrorDetails(const ::google::rpc::Status& from, |
|
|
|
|
grpc::Status* to); |
|
|
|
|
|
|
|
|
|
} // namespace grpc
|
|
|
|
|
|
|
|
|
|
#endif // GRPCPP_SUPPORT_ERROR_DETAILS_H
|
|
|
|
|
#endif // GRPCPP_SUPPORT_ERROR_DETAILS_IMPL_H
|
|
|
|
|