APIs, concepts, guides, and more

◆ CheckErrors()

static void CheckErrors ( RapidCodeObject rsiObject)
static
Parameters
rsiObjectPointer to the RapidCodeObject to check for errors.
Exceptions
ExceptionThrown if any non-warning errors are encountered in the error log of the RapidCodeObject.
public static void CheckErrors(RapidCodeObject rsiObject)
{
bool hasErrors = false;
System.Text.StringBuilder errorStringBuilder = new System.Text.StringBuilder();
while (rsiObject.ErrorLogCountGet() > 0)
{
RsiError error = rsiObject.ErrorLogGet();
if (error.isWarning)
{
errorStringBuilder.AppendLine("WARNING: " + error.Message);
}
else
{
hasErrors = true;
errorStringBuilder.AppendLine("ERROR: " + error.Message);
}
}
if (hasErrors)
{
throw new Exception(errorStringBuilder.ToString());
}
}
See also
StartTheNetwork @[Check-Errors-cs]
Examples
MathBlock.cs.

Definition at line 26 of file HelperFunctionsCS.cs.