Fix static code analysis tool failures
Uncaught exception (boost::system::system_error) is now caught.
Change-Id: I0aa88f173a982ecebfa999fd44ed864be709240c
Signed-off-by: Wojciech Tempczyk <wojciechx.tempczyk@intel.com>
diff --git a/src/report.cpp b/src/report.cpp
index 26fcd0b..c480675 100644
--- a/src/report.cpp
+++ b/src/report.cpp
@@ -409,10 +409,19 @@
void Report::scheduleTimerForPeriodicReport(Milliseconds timerInterval)
{
- timer.expires_after(timerInterval);
- timer.async_wait([this](boost::system::error_code ec) {
- timerProcForPeriodicReport(ec, *this);
- });
+ try
+ {
+ timer.expires_after(timerInterval);
+ timer.async_wait([this](boost::system::error_code ec) {
+ timerProcForPeriodicReport(ec, *this);
+ });
+ }
+ catch (const boost::system::system_error& exception)
+ {
+ phosphor::logging::log<phosphor::logging::level::ERR>(
+ "Failed to schedule timer for periodic report: ",
+ phosphor::logging::entry("EXCEPTION_MSG=%s", exception.what()));
+ }
}
void Report::scheduleTimerForOnChangeReport()