Skip to content

Commit

Permalink
[CM] Handle other exceptions while loading the controller plugin (#1731)
Browse files Browse the repository at this point in the history
  • Loading branch information
saikishor authored Aug 30, 2024
1 parent f743bf4 commit 045b060
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions controller_manager/src/controller_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -467,13 +467,21 @@ controller_interface::ControllerInterfaceBaseSharedPtr ControllerManager::load_c
controller = chainable_loader_->createSharedInstance(controller_type);
}
}
catch (const pluginlib::CreateClassException & e)
catch (const std::exception & e)
{
RCLCPP_ERROR(
get_logger(), "Error happened during creation of controller '%s' with type '%s':\n%s",
get_logger(), "Caught exception while loading the controller '%s' of plugin type '%s':\n%s",
controller_name.c_str(), controller_type.c_str(), e.what());
return nullptr;
}
catch (...)
{
RCLCPP_ERROR(
get_logger(),
"Caught unknown exception while loading the controller '%s' of plugin type '%s'",
controller_name.c_str(), controller_type.c_str());
throw;
}

ControllerSpec controller_spec;
controller_spec.c = controller;
Expand Down

0 comments on commit 045b060

Please sign in to comment.