}
if (status != PRVMGR_ERR_NONE) {
std::string errnum = std::to_string(status);
+ if (error)
+ *error_message = error;
+ else
+ *error_message = "";
LOG(ERROR) << "Error while verifing privilege level: "
- << (error ? error : "") << " <" << errnum << ">";
- *error_message = error;
+ << *error_message << " <" << errnum << ">";
*error_message += ":<" + errnum + ">";
free(error);
return false;
if (status != PRVMGR_ERR_NONE) {
std::string errnum = std::to_string(status);
+ if (error)
+ *error_message = error;
+ else
+ *error_message = "";
LOG(ERROR) << "Error while verifing metadata privilege: "
- << (error ? error : "") << " <" << errnum << ">";
- *error_message = error;
+ << *error_message << " <" << errnum << ">";
*error_message += ":<" + errnum + ">";
free(error);
return false;