[#absl-Status-Update-01]
= xref:absl.adoc[absl]::xref:absl/Status.adoc[Status]::Update
:relfileprefix: ../../
:mrdocs:

Updates the existing status with `new&lowbar;status` provided that `this&hyphen;&gt;ok()`&period;

== Synopsis

Declared in `&lt;absl&sol;status&sol;status&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
Update(xref:absl/Status.adoc[Status] const& new&lowbar;status);
----

== Description

If the existing status already contains a non&hyphen;OK error, this update has no effect and preserves the current data&period; Note that this behavior may change in the future to augment a current non&hyphen;ok status with additional information about `new&lowbar;status`&period;

`Update()` provides a convenient way of keeping track of the first error encountered&period;

Example&colon; &sol;&sol; Instead of &quot;if (overall&lowbar;status&period;ok()) overall&lowbar;status &equals; new&lowbar;status&quot; overall&lowbar;status&period;Update(new&lowbar;status)&semi;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *new&lowbar;status*
| The status to apply if `&ast;this` is currently OK&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
