Skip to content

Commit

Permalink
Log any errors before cancel_init() (#5530)
Browse files Browse the repository at this point in the history
* Log any errors before cancel_init()

Signed-off-by: Santti4go <santiaupi@gmail.com>

* Code style

Signed-off-by: Santti4go <santiaupi@gmail.com>

* Apply suggestion

Signed-off-by: Santti4go <santiaupi@gmail.com>

---------

Signed-off-by: Santti4go <santiaupi@gmail.com>
(cherry picked from commit 165d64e)
  • Loading branch information
Santti4go authored and mergify[bot] committed Jan 8, 2025
1 parent a2d8e8b commit fdd7caa
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/cpp/rtps/security/SecurityManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ bool SecurityManager::init(
ParticipantSecurityAttributes& attributes,
const PropertyPolicy& participant_properties)
{
SecurityException exception;
try
{
SecurityException exception;
domain_id_ = participant_->get_domain_id();
auto part_attributes = participant_->get_attributes();
const PropertyPolicy log_properties = PropertyPolicyHelper::get_properties_with_prefix(
Expand Down Expand Up @@ -396,6 +396,13 @@ bool SecurityManager::init(
{
if (!e)
{
// Unexpected code path. Let's log any errors
logError(SECURITY, "Error while configuring security plugin.")
if (0 != strlen(exception.what()))
{
logError(SECURITY, exception.what())
}

cancel_init();
return false;
}
Expand Down

0 comments on commit fdd7caa

Please sign in to comment.