Move ErrorDetails from ::grpc_impl to ::grpc

Reverts: https://github.com/grpc/grpc/pull/18455
pull/23601/head
Karthik Ravi Shankar 4 years ago
parent 79c1294720
commit db3cd51b2f
  1. 1
      BUILD
  2. 1
      CMakeLists.txt
  3. 1
      Makefile
  4. 28
      include/grpcpp/support/error_details.h
  5. 4
      src/cpp/util/error_details.cc

@ -410,7 +410,6 @@ grpc_cc_library(
hdrs = [
"include/grpc++/support/error_details.h",
"include/grpcpp/support/error_details.h",
"include/grpcpp/support/error_details_impl.h",
],
language = "c++",
standalone = True,

@ -2991,7 +2991,6 @@ target_link_libraries(grpc++_error_details
foreach(_hdr
include/grpc++/support/error_details.h
include/grpcpp/support/error_details.h
include/grpcpp/support/error_details_impl.h
)
string(REPLACE "include/" "" _path ${_hdr})
get_filename_component(_path ${_path} PATH)

@ -5148,7 +5148,6 @@ LIBGRPC++_ERROR_DETAILS_SRC = \
PUBLIC_HEADERS_CXX += \
include/grpc++/support/error_details.h \
include/grpcpp/support/error_details.h \
include/grpcpp/support/error_details_impl.h \
LIBGRPC++_ERROR_DETAILS_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(LIBGRPC++_ERROR_DETAILS_SRC))))

@ -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

@ -20,7 +20,7 @@
#include "src/proto/grpc/status/status.pb.h"
namespace grpc_impl {
namespace grpc {
grpc::Status ExtractErrorDetails(const grpc::Status& from,
::google::rpc::Status* to) {
@ -47,4 +47,4 @@ grpc::Status SetErrorDetails(const ::google::rpc::Status& from,
return grpc::Status::OK;
}
} // namespace grpc_impl
} // namespace grpc

Loading…
Cancel
Save