JanJorgensen / StepBro

Automation framework for .net
MIT License
3 stars 0 forks source link

If an await operation on SerialTestConnection.SendCommand fails with an error, the test script stops #321

Closed MolaeMaceria closed 2 months ago

MolaeMaceria commented 2 months ago

The test script should just log that an error occurred and then continue with the next test.

This is because the IsFaulted property on CommandData is checked and then ReportError is called which stops the execution completely. LogError or similar should probably be called instead in the places where CommandData.IsFaulted is checked.

JanJorgensen commented 2 months ago

No change needed. In the script the following code can be used if error handling is needed.

procedure void ProofOfConcept()
{
    var result = connection.SendCommand("about");
    while (!result.IsCompleted)
    {
        delay(10ms);
    }

    if (result.IsFaulted)
    {
        // Try again
    }
}