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
(cherry picked from commit 045b060)
  • Loading branch information
saikishor authored and mergify[bot] committed Aug 30, 2024
1 parent caa242f commit 0fa410b
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 @@ -556,13 +556,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 0fa410b

Please sign in to comment.