[#BloombergLP-balxml-ErrorInfo-setError-04]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/balxml.adoc[balxml]::xref:BloombergLP/balxml/ErrorInfo.adoc[ErrorInfo]::setError
:relfileprefix: ../../../
:mrdocs:

Conditionally set this object&apos;s diagnostic from the specified values&period;

== Synopsis

Declared in `&lt;balxml&lowbar;errorinfo&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
setError(
    xref:BloombergLP/balxml/ErrorInfo/Severity-0f.adoc[Severity] severity,
    int lineNumber,
    int columnNumber,
    std::string&lowbar;view const& source,
    std::string&lowbar;view const& errorMsg);
----

== Description

If the specified `severity` is greater than the current value of `this&hyphen;&gt;severity()`, then set this object&apos;s severity to `severity`, line number to the specified `lineNumber`, column number to the specified `columnNumber`, source name to the specified `source`, and error message to the specified `errorMsg`, otherwise do nothing&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *severity*
| severity of the diagnostic
| *lineNumber*
| line number of the diagnostic
| *columnNumber*
| column number of the diagnostic
| *source*
| name of the document containing the diagnostic
| *errorMsg*
| description of the diagnostic
|===


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