Skip to content

Commit 634b02a

Browse files
Enhance error handling in MQTT subscription callback by verifying scheduling success and logging errors if any occur.
1 parent 60c2ab9 commit 634b02a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

examples/platform/silabs/matter_aws/matter_aws_interface/src/MatterAwsControl.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,8 @@ void SubscribeMQTT(intptr_t context)
291291

292292
void subscribeCB(void)
293293
{
294-
chip::DeviceLayer::PlatformMgr().ScheduleWork(SubscribeMQTT, reinterpret_cast<intptr_t>(nullptr));
294+
CHIP_ERROR err = chip::DeviceLayer::PlatformMgr().ScheduleWork(SubscribeMQTT, reinterpret_cast<intptr_t>(nullptr));
295+
VerifyOrReturn(CHIP_NO_ERROR == err, ChipLogError(AppServer, "[MATTER_AWS] failed to schedule work: %s", err.AsString()));
295296
}
296297

297298
#ifdef ZCL_USING_THERMOSTAT_CLUSTER_SERVER

0 commit comments

Comments
 (0)