Skip to content
Snippets Groups Projects
Commit ccec3c51 authored by Alexandre MALFREYT's avatar Alexandre MALFREYT
Browse files

fix: improve error logging for get_device_property in init_device (logs and status)

parent e9bc2d69
Branches
Tags
1 merge request!4develop -> main
...@@ -277,8 +277,15 @@ void SingleShotAO::init_device() ...@@ -277,8 +277,15 @@ void SingleShotAO::init_device()
ERROR_STREAM << "SingleShotAO::init_device::Tango::DevFailed exception caught " ERROR_STREAM << "SingleShotAO::init_device::Tango::DevFailed exception caught "
<< "while trying to read device properties from TANGO database" << "while trying to read device properties from TANGO database"
<< std::endl; << std::endl;
ERROR_STREAM << df << std::endl; std::string error_msg = df.errors[0].desc;
m_currStatus = "Failed to get property. See log for details"; std::istringstream error_stream(error_msg);
std::string line;
std::getline(error_stream, line); // Read the first line
ERROR_STREAM << line << std::endl;
while (std::getline(error_stream, line)) { // Read the rest of the lines
ERROR_STREAM << " - " << line << std::endl;
}
m_currStatus = error_msg;
m_state = Tango::FAULT; m_state = Tango::FAULT;
return; return;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment