From b700fb894018ea02f7bf701f66cd80f5fb6b096a Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Thu, 20 Jan 2022 08:54:25 +0100 Subject: [PATCH] [chip-tool] When sending a command fails for some reasons, chip-tool ignore the error (#13690) --- examples/chip-tool/commands/clusters/ModelCommand.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/chip-tool/commands/clusters/ModelCommand.cpp b/examples/chip-tool/commands/clusters/ModelCommand.cpp index a8e5ddd0071086..bf1af719280ae9 100644 --- a/examples/chip-tool/commands/clusters/ModelCommand.cpp +++ b/examples/chip-tool/commands/clusters/ModelCommand.cpp @@ -33,7 +33,9 @@ void ModelCommand::OnDeviceConnectedFn(void * context, ChipDevice * device) { ModelCommand * command = reinterpret_cast(context); VerifyOrReturn(command != nullptr, ChipLogError(chipTool, "OnDeviceConnectedFn: context is null")); - command->SendCommand(device, command->mEndPointId); + + CHIP_ERROR err = command->SendCommand(device, command->mEndPointId); + VerifyOrReturn(CHIP_NO_ERROR == err, command->SetCommandExitStatus(err)); } void ModelCommand::OnDeviceConnectionFailureFn(void * context, PeerId peerId, CHIP_ERROR err)