Skip to content

Commit

Permalink
update error message
Browse files Browse the repository at this point in the history
  • Loading branch information
haiqi96 committed Jul 30, 2024
1 parent c9d2a17 commit 6f2296c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion components/core/src/clp/hash_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,14 @@ namespace {
*/
auto get_openssl_error_string() -> string {
auto const openssl_err = ERR_get_error();
return {ERR_error_string(openssl_err, nullptr)};
if (0 == openssl_err) {
return {};
}
auto* openssl_err_str = ERR_error_string(openssl_err, nullptr);
if (nullptr == openssl_err_str) {
return {"Error has no string representation, error_code: " + std::to_string(openssl_err)};
}
return {openssl_err_str};
}

/**
Expand Down

0 comments on commit 6f2296c

Please sign in to comment.