From b726abcb694aed70b72a765a7e5db391edbdc08e Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Thu, 17 Mar 2022 15:47:30 -0400 Subject: [PATCH] Remove LogErrorOnFailure --- src/lib/dnssd/Advertiser_ImplMinimalMdns.cpp | 23 +++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/src/lib/dnssd/Advertiser_ImplMinimalMdns.cpp b/src/lib/dnssd/Advertiser_ImplMinimalMdns.cpp index ca2cd704c4c732..fed0c271dc0f9c 100644 --- a/src/lib/dnssd/Advertiser_ImplMinimalMdns.cpp +++ b/src/lib/dnssd/Advertiser_ImplMinimalMdns.cpp @@ -155,8 +155,19 @@ class AdvertiserMinMdns : public ServiceAdvertiser, AdvertiserMinMdns() : mResponseSender(&GlobalMinimalMdnsServer::Server()) { GlobalMinimalMdnsServer::Instance().SetQueryDelegate(this); - LogErrorOnFailure(mResponseSender.AddQueryResponder(mQueryResponderAllocatorCommissionable.GetQueryResponder())); - LogErrorOnFailure(mResponseSender.AddQueryResponder(mQueryResponderAllocatorCommissioner.GetQueryResponder())); + + CHIP_ERROR err = mResponseSender.AddQueryResponder(mQueryResponderAllocatorCommissionable.GetQueryResponder()); + + if (err != CHIP_NO_ERROR) + { + ChipLogError(Discovery, "Failed to setup commissionable responder: %" CHIP_ERROR_FORMAT, err.Format()); + } + + err = mResponseSender.AddQueryResponder(mQueryResponderAllocatorCommissioner.GetQueryResponder()); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Discovery, "Failed to setup commissioner responder: %" CHIP_ERROR_FORMAT, err.Format()); + } } ~AdvertiserMinMdns() override {} @@ -342,7 +353,13 @@ CHIP_ERROR AdvertiserMinMdns::RemoveServices() // Mark as unused ptr->GetAllocator()->Clear(); - LogErrorOnFailure(mResponseSender.RemoveQueryResponder(ptr->GetAllocator()->GetQueryResponder())); + + CHIP_ERROR err = mResponseSender.RemoveQueryResponder(ptr->GetAllocator()->GetQueryResponder()); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Discovery, "Failed to remove query responder: %" CHIP_ERROR_FORMAT, err.Format()); + } + mOperationalResponders.Remove(ptr); // Finally release the memory