From f5170fd9f0a4fa1caa9f3d8a78fc38c720603735 Mon Sep 17 00:00:00 2001 From: Nav Date: Sun, 1 May 2022 21:17:55 +0100 Subject: [PATCH] Handled errors in TargetReset event handler (in the InsightWorker) --- src/Insight/InsightWorker/InsightWorker.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/Insight/InsightWorker/InsightWorker.cpp b/src/Insight/InsightWorker/InsightWorker.cpp index bea72429..9f0186cf 100644 --- a/src/Insight/InsightWorker/InsightWorker.cpp +++ b/src/Insight/InsightWorker/InsightWorker.cpp @@ -121,10 +121,15 @@ namespace Bloom } void InsightWorker::onTargetResetEvent(const Events::TargetReset& event) { - this->lastTargetState = TargetState::STOPPED; - emit this->targetStateUpdated(TargetState::RUNNING); - emit this->targetStateUpdated(TargetState::STOPPED); - emit this->targetProgramCounterUpdated(this->targetControllerConsole.getProgramCounter()); + try { + this->lastTargetState = TargetState::STOPPED; + emit this->targetStateUpdated(TargetState::RUNNING); + emit this->targetStateUpdated(TargetState::STOPPED); + emit this->targetProgramCounterUpdated(this->targetControllerConsole.getProgramCounter()); + + } catch (const Exceptions::Exception& exception) { + Logger::debug("Error handling TargetReset event - " + exception.getMessage()); + } } void InsightWorker::onTargetRegistersWrittenEvent(const Events::RegistersWrittenToTarget& event) {