absl::StatusBuilder::SetCode

Sets the status code for the status that will be returned by this StatusBuilder.

Synopses

Declared in <absl/status/status_builder.h>

Sets the status code for the status that will be returned by this StatusBuilder.

StatusBuilder&
SetCode(absl::StatusCode code) &;
» more...

Sets the status code for the status that will be returned by this StatusBuilder.

[[nodiscard]]
StatusBuilder&&
SetCode(absl::StatusCode code) &&;
» more...

Return Value

*this to allow method chaining.

Parameters

NameDescription
codeThe canonical status code to set.