[#absl-ExtraMessage] = xref:absl.adoc[absl]::ExtraMessage :relfileprefix: ../ :mrdocs: StatusBuilder policy to append an extra message to the original status. == Synopsis Declared in `<absl/status/status_builder.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- class ExtraMessage; ---- == Description This is most useful with adaptors such as `util::TaskReturn` that otherwise would prevent use of `operator<<`. For example: ABSL_RETURN_IF_ERROR(foo(val)) .With(absl::ExtraMessage("when calling foo()")) .With(util::TaskReturn(task)); or ABSL_RETURN_IF_ERROR(foo(val)) .With(absl::ExtraMessage() << "val: " << val) .With(util::TaskReturn(task)); Note in the above example, the `ABSL_RETURN_IF_ERROR` macro ensures the `ExtraMessage` expression is evaluated only in the error case, so efficiency of constructing the message is not a concern in the success case. == Member Functions [cols="1,4"] |=== | Name| Description | xref:absl/ExtraMessage/2constructor-085.adoc[`ExtraMessage`] [.small]#[constructor]# | Constructors | xref:absl/ExtraMessage/operator_call.adoc[`operator()`] | Appends the accumulated extra message to `builder`. | xref:absl/ExtraMessage/operator_lshift-0a.adoc[`operator<<`] | Left shift operators |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#