From 92e55641a0a318801ee578253ad752a92d768f6e Mon Sep 17 00:00:00 2001 From: Hayodea Hakol Date: Tue, 16 Sep 2025 18:36:50 -0400 Subject: [PATCH] LivoxGen1: Replace throw with cb+early ret --- senseApis/livoxGen1/livoxGen1.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/senseApis/livoxGen1/livoxGen1.cpp b/senseApis/livoxGen1/livoxGen1.cpp index 98eec22..9eb6836 100644 --- a/senseApis/livoxGen1/livoxGen1.cpp +++ b/senseApis/livoxGen1/livoxGen1.cpp @@ -304,9 +304,11 @@ extern "C" void livoxGen1_detachDeviceReq( if (it == g_attachedDevices.end()) { - throw std::runtime_error( - std::string(__func__) + - ": Device not found for detachment: " + desc->deviceIdentifier); + std::cerr << std::string(__func__) + << ": Device not found for detachment: " + << desc->deviceIdentifier << std::endl; + cb(false, desc); + return; } (*livoxProto1.livoxProto1_destroyDeviceReq)(