From 0172351e8934f358f117bd8398e98c8bea164f11 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 2 May 2022 22:58:06 +0200 Subject: [PATCH] additional try catch block --- mission/devices/HeaterHandler.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/mission/devices/HeaterHandler.cpp b/mission/devices/HeaterHandler.cpp index 3582edb0..5771e27b 100644 --- a/mission/devices/HeaterHandler.cpp +++ b/mission/devices/HeaterHandler.cpp @@ -37,10 +37,15 @@ HeaterHandler::HeaterHandler(object_id_t setObjectId_, GpioIF* gpioInterface_, H HeaterHandler::~HeaterHandler() {} ReturnValue_t HeaterHandler::performOperation(uint8_t operationCode) { - readCommandQueue(); - handleActiveCommands(); - for (const auto& heater : helper.heaters) { - heater.first->performOperation(0); + try { + readCommandQueue(); + handleActiveCommands(); + for (const auto& heater : helper.heaters) { + heater.first->performOperation(0); + } + } catch(const std::out_of_range& e) { + sif::warning << "HeaterHandler::performOperation: " + "Out of range error | " << e.what() << std::endl; } return RETURN_OK; }