diff --git a/src/cpp/rtps/security/SecurityManager.cpp b/src/cpp/rtps/security/SecurityManager.cpp index 9852e875743..aa66847770d 100644 --- a/src/cpp/rtps/security/SecurityManager.cpp +++ b/src/cpp/rtps/security/SecurityManager.cpp @@ -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( @@ -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; }