From bde12f58b288b0a6d49ca089e20154feba14563a Mon Sep 17 00:00:00 2001 From: Alexey Rybalchenko Date: Tue, 9 Oct 2018 16:41:09 +0200 Subject: [PATCH] Handle errors in static and interactive controllers --- fairmq/plugins/Control.cxx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/fairmq/plugins/Control.cxx b/fairmq/plugins/Control.cxx index c7262bd0..1cabc920 100644 --- a/fairmq/plugins/Control.cxx +++ b/fairmq/plugins/Control.cxx @@ -209,6 +209,11 @@ try } } + if (GetCurrentDeviceState() == DeviceState::Error) + { + throw DeviceErrorState("Controlled device transitioned to error state."); + } + if (fDeviceShutdownRequested) { break; @@ -273,6 +278,11 @@ try { fNewEvent.wait_for(lock, chrono::milliseconds(50)); } + + if (fEvents.front() == DeviceState::Error) + { + throw DeviceErrorState("Controlled device transitioned to error state."); + } } RunShutdownSequence();