Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PEL for vpd_specific_utility file #563

Open
wants to merge 1 commit into
base: 1110
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 20 additions & 9 deletions vpd-manager/include/utility/vpd_specific_utility.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "config.h"

#include "constants.hpp"
#include "event_logger.hpp"
#include "exceptions.hpp"
#include "logger.hpp"
#include "types.hpp"
Expand Down Expand Up @@ -202,10 +203,12 @@ inline void insertOrMerge(types::InterfaceMap& map,
}
catch (const std::exception& l_ex)
{
// ToDo:: Log PEL
logging::logMessage(
"Inserting properties into interface[" + interface +
"] map is failed, reason: " + std::string(l_ex.what()));
EventLogger::createSyncPel(
types::ErrorType::InvalidVpdMessage,
types::SeverityType::Informational, __FILE__, __FUNCTION__, 0,
"Inserting properties into interface [" + interface +
"] map is failed, reason: " + std::string(l_ex.what()),
std::nullopt, std::nullopt, std::nullopt, std::nullopt);
}
}
else
Expand Down Expand Up @@ -335,10 +338,14 @@ inline std::string
expanded.replace(pos, 3, firstKwdValue + "." + secondKwdValue);
}
}
catch (const std::exception& ex)
catch (const std::exception& l_ex)
{
logging::logMessage("Failed to expand location code with exception: " +
std::string(ex.what()));
EventLogger::createSyncPel(
types::ErrorType::InvalidVpdMessage,
types::SeverityType::Informational, __FILE__, __FUNCTION__, 0,
"Failed to expand location code [ " + unexpandedLocationCode +
" ] with exception: " + std::string(l_ex.what()),
std::nullopt, std::nullopt, std::nullopt, std::nullopt);
}

return expanded;
Expand Down Expand Up @@ -548,8 +555,12 @@ inline void resetDataUnderPIM(const std::string& i_objectPath,
}
catch (const std::exception& l_ex)
{
logging::logMessage("Failed to remove VPD for FRU: " + i_objectPath +
" with error: " + std::string(l_ex.what()));
EventLogger::createSyncPel(
types::ErrorType::InvalidVpdMessage,
types::SeverityType::Informational, __FILE__, __FUNCTION__, 0,
"Failed to remove VPD for FRU: " + i_objectPath +
" with error: " + std::string(l_ex.what()),
std::nullopt, std::nullopt, std::nullopt, std::nullopt);
}
}
} // namespace vpdSpecificUtility
Expand Down