absl::StatusBuilder::SetPayload

Adds a payload for the status that will be returned by this StatusBuilder.

Synopsis

Declared in <absl/status/status_builder.h>

[[nodiscard]]
StatusBuilder&&
SetPayload(
    std::string_view type_url,
    absl::Cord payload) &&;

Description

Note that this is equivalent to Status::SetPayload; to attach protos to the MessageSet payload, use util::AttachPayload.

Return Value

*this to allow method chaining.

NOTE

The return value should not be discarded.

Parameters

NameDescription
type_urlThe type URL identifying the payload.
payloadThe payload data to attach.