absl::Status::GetPayload

Gets the payload of a status given its unique type_url key, if present.

Synopsis

Declared in <absl/status/status.h>

std::optional<absl::Cord>
GetPayload(std::string_view type_url) const;

Return Value

The payload if present, or std::nullopt otherwise.

Parameters

NameDescription
type_urlThe unique key identifying the payload.