Improved logging of some errors in AsynchronousMetrics.

This commit is contained in:
Vladimir Chebotarev 2021-07-30 17:36:28 +03:00
parent c18c16855a
commit 3c3fbf9a53

View File

@ -1045,7 +1045,14 @@ void AsynchronousMetrics::update(std::chrono::system_clock::time_point update_ti
{
sensor_file->rewind();
Int64 temperature = 0;
readText(temperature, *sensor_file);
try
{
readText(temperature, *sensor_file);
}
catch(const ErrnoException & e)
{
LOG_DEBUG(&Poco::Logger::get("AsynchronousMetrics"), "Hardware monitor '{}', sensor '{}' exists but could not be read, error {}.", hwmon_name, sensor_name, e.getErrno());
}
if (sensor_name.empty())
new_values[fmt::format("Temperature_{}", hwmon_name)] = temperature * 0.001;