absl/status/status.cc
// Convert canonical code to a value known to this binary.
Convert canonical code to a value known to this binary.
Convert canonical code to a value known to this binary .
absl::StatusCode MapToLocalCode(int value) {
  absl::StatusCode code = static_cast<absl::StatusCode>(value);
  switch (code) {
    case absl::StatusCode::kOk:
    case absl::StatusCode::kCancelled:
    case absl::StatusCode::kUnknown:
    case absl::StatusCode::kInvalidArgument:
    case absl::StatusCode::kDeadlineExceeded:
    case absl::StatusCode::kNotFound:
    case absl::StatusCode::kAlreadyExists:
    case absl::StatusCode::kPermissionDenied:
    case absl::StatusCode::kResourceExhausted:
    case absl::StatusCode::kFailedPrecondition:
    case absl::StatusCode::kAborted:
    case absl::StatusCode::kOutOfRange:
    case absl::StatusCode::kUnimplemented:
    case absl::StatusCode::kInternal:
    case absl::StatusCode::kUnavailable:
    case absl::StatusCode::kDataLoss:
    case absl::StatusCode::kUnauthenticated:
      return code;
    default:
      return absl::StatusCode::kUnknown;
  }
}
absl :: StatusCode MapToLocalCode ( int value ) { absl :: StatusCode code = static_cast < absl :: StatusCode > ( value ) ; switch ( code ) { case absl :: StatusCode :: kOk : case absl :: StatusCode :: kCancelled : case absl :: StatusCode :: kUnknown : case absl :: StatusCode :: kInvalidArgument : case absl :: StatusCode :: kDeadlineExceeded : case absl :: StatusCode :: kNotFound : case absl :: StatusCode :: kAlreadyExists : case absl :: StatusCode :: kPermissionDenied : case absl :: StatusCode :: kResourceExhausted : case absl :: StatusCode :: kFailedPrecondition : case absl :: StatusCode :: kAborted : case absl :: StatusCode :: kOutOfRange : case absl :: StatusCode :: kUnimplemented : case absl :: StatusCode :: kInternal : case absl :: StatusCode :: kUnavailable : case absl :: StatusCode :: kDataLoss : case absl :: StatusCode :: kUnauthenticated : return code ; default : return absl :: StatusCode :: kUnknown ; } }
Convert canonical code to a value known to this binary.
Convert canonical code to a value known to this binary .