Skip to content

Latest commit

 

History

History
55 lines (38 loc) · 1.27 KB

L88-cpp-absl-status-conversions.md

File metadata and controls

55 lines (38 loc) · 1.27 KB

Provide conversions from grpc::Status to absl::Status and back again

  • Author(s): ctiller
  • Approver: roth
  • Status: {In Review}
  • Implemented in: grpc/grpc#27903
  • Last updated: November 1, 2021
  • Discussion at:

Abstract

Add conversion operations between absl::Status and grpc::Status to help boost interoperability with that library, and to aid in modernizing our codebase.

Background

grpc::Status was originally intended to be a polyfill for absl::Status. The released absl::Status however was not directly compatible with grpc::Status. Introduce canonical conversion operations between the two types.

Related Proposals:

N/A

Proposal

Add to grpc::Status:

  • an explicit conversion from absl::Status
  • implicit const& and && conversion operators to absl::Status

i.e.:

namespace grpc {
class Status {
 public:
  // ...
  explicit Status(absl::Status&&);
  operator const absl::Status&() const;
};
}

Rationale

We'd like to change to absl::Status everywhere, but we can't. Internal users are experiencing pain since these conversions are available there, but not externally.

Implementation

This proposal will be implemented as a single PR (and likely an associated cherry-pick internally).

Open issues (if applicable)

N/A