[#absl-Status-2constructor-00]
= xref:absl.adoc[absl]::xref:absl/Status.adoc[Status]::Status
:relfileprefix: ../../
:mrdocs:

Creates a status in the canonical error space with the specified `absl&colon;&colon;StatusCode` and error message&period; If `code &equals;&equals; absl&colon;&colon;StatusCode&colon;&colon;kOk`, `msg` is ignored and an object identical to an OK status is constructed&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
Status(
    xref:absl/StatusCode.adoc[absl::StatusCode] code,
    std::string&lowbar;view msg,
    xref:absl/SourceLocation.adoc[absl::SourceLocation] loc = SourceLocation&colon;&colon;current());
----

== Description

The `msg` string must be in UTF&hyphen;8&period; The implementation may complain (e&period;g&period;, by printing a warning) if it is not&period;

The `loc` is the SourceLocation of the callsite&period; It will be stored in the Status iff `code !&equals; absl&colon;&colon;StatusCode&colon;&colon;kOk` and `!msg&period;empty()`&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *code*
| The canonical error code for the status&period;
| *msg*
| The UTF&hyphen;8 error message&period;
| *loc*
| The source location of the callsite&period;
|===


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