abseil / Abseil Status

/2020-091021-status

  • Abseil Status
    https://abseil.io/blog/2020-091021-status

    By Xiaoyi Zhang, Google Engineer, Emeritus

    The Abseil status library is now available on abseil.io. This library is used within Google for error handling and contains the following two abstractions:

    absl::Status absl::StatusOr

    Within Google, absl::Status is the primary mechanism to gracefully handle errors across API boundaries (and in particular across RPC boundaries). Some of these errors may be recoverable, but others may not. Most functions that can produce a recoverable error should be designed to return either an absl::Status (or the similar absl::StatusOr, which holds either an object of type T or an error).

    A Status can either return “OK” (represented by the enumumerated value absl::StatusCode::kOk) or one of a number of canonical error codes to indicate certain error (...)