Skip to content

Use dlerror() to get error message when calling dlopen failed. #338

@minggangw

Description

@minggangw

Currently we will not check the return value of dlopen(), so when the dlopen failed, a nullptr will be passed to the rcl library, please see:

 const rosidl_message_type_support_t* ts =
      GetMessageTypeSupport(package_name, message_sub_folder, message_name);

  THROW_ERROR_IF_NOT_EQUAL(
      RCL_RET_OK,
      rcl_subscription_init(subscription, node, ts, topic.c_str(),
                            &subscription_ops),
rcl_get_error_string_safe());

We'd better check the |ts| and use dlerror() to get the error message to be returned.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions