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 christophfroehlich committed Aug 30, 2024
1 parent 4659d58 commit b8187f2
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 b8187f2

Please sign in to comment.