Skip to content

Commit

Permalink
Fix error code when cluster not exists
Browse files Browse the repository at this point in the history
  • Loading branch information
erjiaqing committed May 21, 2021
1 parent aee9d58 commit 0ba84d4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/app/CommandHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,9 @@ CHIP_ERROR CommandHandler::ProcessCommandDataElement(CommandDataElement::Parser

// The Path is not present when there is an error to be conveyed back. ResponseCommandElement would only have status code,
// set the error with CHIP_NO_ERROR, then continue to process rest of commands
AddStatusCode(&returnStatusParam, GeneralStatusCode::kInvalidArgument, Protocols::SecureChannel::Id,
Protocols::SecureChannel::kProtocolCodeGeneralFailure);
AddStatusCode(&returnStatusParam,
err == CHIP_ERROR_INVALID_PROFILE_ID ? GeneralStatusCode::kNotFound : GeneralStatusCode::kInvalidArgument,
Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure);
err = CHIP_NO_ERROR;
}
return err;
Expand Down

0 comments on commit 0ba84d4

Please sign in to comment.