Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(default_ad_api): add log when operation mode change fails #1347

Merged
merged 1 commit into from
Jun 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion system/default_ad_api/src/operation_mode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,13 @@ void OperationModeNode::change_mode(
const ResponseT res, const OperationModeRequest::_mode_type mode)
{
if (!mode_available_[mode]) {
RCLCPP_WARN(
get_logger(),
"The target mode is not available. Please check the cause with "
"rqt_diagnostics_graph_monitor");
throw component_interface_utils::ServiceException(
ServiceResponse::ERROR_NOT_AVAILABLE, "The mode change is blocked by the system.");
ServiceResponse::ERROR_NOT_AVAILABLE,
"The target mode is not available. Please check the diagnostics.");
}
const auto req = std::make_shared<OperationModeRequest>();
req->mode = mode;
Expand Down
Loading