Skip to content

Commit

Permalink
Merge pull request #1347 from tier4/add-log-modechange-fail
Browse files Browse the repository at this point in the history
feat(default_ad_api): add log when operation mode change fails
  • Loading branch information
TakaHoribe authored Jun 20, 2024
2 parents 46adcc6 + 2217b65 commit fcf5e96
Showing 1 changed file with 6 additions and 1 deletion.
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

0 comments on commit fcf5e96

Please sign in to comment.