APIs, concepts, guides, and more

◆ CheckErrors()

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.
Code Snippet
public static void CheckErrors(RapidCodeObject rsiObject)
{
var hasErrors = false;
var errorStrBuilder = new System.Text.StringBuilder();
while (rsiObject.ErrorLogCountGet() > 0)
{
// get error
RsiError rsiError = rsiObject.ErrorLogGet();
// get message
var errorMsg = rsiError.isWarning ? $"WARNING: {rsiError.Message}" : $"ERROR: {rsiError.Message}";
errorStrBuilder.AppendLine(errorMsg);
// set flag
hasErrors = !rsiError.isWarning;
}
if (hasErrors)
throw new Exception(errorStrBuilder.ToString());
}
See also
NetworkStart

Definition at line 15 of file _helpers.cs.