diff options
-rw-r--r-- | ipmi_fru_info_area.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/ipmi_fru_info_area.cpp b/ipmi_fru_info_area.cpp index 089a7cb..47a8a8e 100644 --- a/ipmi_fru_info_area.cpp +++ b/ipmi_fru_info_area.cpp @@ -135,7 +135,17 @@ void appendChassisType(const PropertyMap& propMap, FruAreaData& data) if (iter != propMap.end()) { auto value = iter->second; - chassisType = std::stoi(value); + try + { + chassisType = std::stoi(value); + } + catch (std::exception& e) + { + log<level::ERR>("Could not parse chassis type", + entry("VALUE=%s", value.c_str()), + entry("ERROR=%s", e.what())); + chassisType = 0; + } } data.emplace_back(chassisType); } |