Skip to content

Commit

Permalink
Handle rmw_fastrtps_dynamic_cpp client typesupport errors too
Browse files Browse the repository at this point in the history
Signed-off-by: Michel Hidalgo <[email protected]>
  • Loading branch information
hidmic committed Dec 15, 2020
1 parent 11d0162 commit b45a8ec
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion rmw_fastrtps_dynamic_cpp/src/rmw_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,19 @@ rmw_create_client(
const rosidl_service_type_support_t * type_support = get_service_typesupport_handle(
type_supports, rosidl_typesupport_introspection_c__identifier);
if (!type_support) {
rcutils_error_string_t prev_error_string = rcutils_get_error_string();
rcutils_reset_error();
type_support = get_service_typesupport_handle(
type_supports, rosidl_typesupport_introspection_cpp::typesupport_identifier);
if (!type_support) {
rcutils_error_string_t error_string = rcutils_get_error_string();
rcutils_reset_error();
RMW_SET_ERROR_MSG("type support not from this implementation");
RMW_SET_ERROR_MSG_WITH_FORMAT_STRING(
"Type support not from this implementation. Got:\n"
" %s\n"
" %s\n"
"while fetching it",
prev_error_string.str, error_string.str);
return nullptr;
}
}
Expand Down

0 comments on commit b45a8ec

Please sign in to comment.