Handle errors in static and interactive controllers

This commit is contained in:
Alexey Rybalchenko 2018-10-09 16:41:09 +02:00 committed by Dennis Klein
parent 45354f268b
commit bde12f58b2

View File

@ -209,6 +209,11 @@ try
} }
} }
if (GetCurrentDeviceState() == DeviceState::Error)
{
throw DeviceErrorState("Controlled device transitioned to error state.");
}
if (fDeviceShutdownRequested) if (fDeviceShutdownRequested)
{ {
break; break;
@ -273,6 +278,11 @@ try
{ {
fNewEvent.wait_for(lock, chrono::milliseconds(50)); fNewEvent.wait_for(lock, chrono::milliseconds(50));
} }
if (fEvents.front() == DeviceState::Error)
{
throw DeviceErrorState("Controlled device transitioned to error state.");
}
} }
RunShutdownSequence(); RunShutdownSequence();