diff --git a/examples/shell/shell_common/cmd_ping.cpp b/examples/shell/shell_common/cmd_ping.cpp index d399a24f23bfc6..471b37561f166f 100644 --- a/examples/shell/shell_common/cmd_ping.cpp +++ b/examples/shell/shell_common/cmd_ping.cpp @@ -161,7 +161,7 @@ CHIP_ERROR SendEchoRequest(streamer_t * stream) char * requestData = nullptr; uint32_t size = gPingArguments.GetEchoReqSize(); - VerifyOrExit(size <= kMaxPayloadSize, err = CHIP_ERROR_INVALID_MESSAGE_LENGTH); + VerifyOrExit(size <= kMaxPayloadSize, err = CHIP_ERROR_MESSAGE_TOO_LONG); requestData = static_cast(chip::Platform::MemoryAlloc(size)); VerifyOrExit(requestData != nullptr, err = CHIP_ERROR_NO_MEMORY);