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 345c2e4 commit 892ca86
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 @@ -105,9 +105,9 @@ bool SecurityManager::init(
ParticipantSecurityAttributes& attributes,
const PropertyPolicy& participant_properties)
{
SecurityException exception;
try
{
SecurityException exception;
domain_id_ = participant_->get_domain_id();
const PropertyPolicy log_properties = PropertyPolicyHelper::get_properties_with_prefix(
participant_->getRTPSParticipantAttributes().properties,
Expand Down Expand Up @@ -383,6 +383,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 892ca86

Please sign in to comment.