Skip to content

Commit

Permalink
Refs #22627: Distinguish Log error if the EASY_MODE IP conflicts with…
Browse files Browse the repository at this point in the history
… a previous one

Signed-off-by: Mario Dominguez <[email protected]>
  • Loading branch information
Mario-DL committed Jan 16, 2025
1 parent e2c2479 commit d495f7f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/cpp/rtps/RTPSDomain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -614,9 +614,20 @@ RTPSParticipant* RTPSDomainImpl::clientServerEnvironmentCreationOverride(
.value(std::to_string(domain_id))
.value(easy_mode_env_value + ":" + std::to_string(domain_id))
.build_and_call();
if (res != 0)

// Python subprocess multiplies by 256 the result code
res /= 256;

if (res != SystemCommandBuilder::SystemCommandResult::SUCCESS)
{
EPROSIMA_LOG_ERROR(DOMAIN, "Auto discovery server client setup. Unable to spawn daemon.");
if (res == SystemCommandBuilder::SystemCommandResult::BAD_PARAM)
{
EPROSIMA_LOG_ERROR(DOMAIN, "EASY_MODE IP connection conflicts with a previous one.");
}
else
{
EPROSIMA_LOG_ERROR(DOMAIN, "Auto discovery server client setup. Unable to spawn daemon.");
}
return nullptr;
}
}
Expand Down
8 changes: 8 additions & 0 deletions src/cpp/utils/SystemCommandBuilder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ class SystemCommandBuilder
{
public:

enum SystemCommandResult
{
SUCCESS = 0,
FAILURE,
BAD_PARAM,
INVALID
};

SystemCommandBuilder() = default;

SystemCommandBuilder& executable(
Expand Down

0 comments on commit d495f7f

Please sign in to comment.