Skip to content

Commit 377c8ea

Browse files
Maybe fix
1 parent 59bc2fd commit 377c8ea

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

src/local_participant.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include "livekit/local_video_track.h"
3030
#include "livekit/room_delegate.h"
3131
#include "livekit/track.h"
32+
#include "lk_log.h"
3233
#include "participant.pb.h"
3334
#include "room.pb.h"
3435
#include "room_proto_converter.h"
@@ -439,7 +440,17 @@ void LocalParticipant::handleRpcMethodInvocation(uint64_t invocation_id, const s
439440
if (response_payload.has_value()) {
440441
msg->set_payload(*response_payload);
441442
}
442-
FfiClient::instance().sendRequest(req);
443+
// This is invoked on the FFI listener thread; an unhandled throw here would
444+
// call std::terminate. The caller will observe a timeout instead.
445+
try {
446+
FfiClient::instance().sendRequest(req);
447+
} catch (const std::exception& e) {
448+
LK_LOG_ERROR("LocalParticipant: failed to send RPC invocation response (invocation_id={}): {}", invocation_id,
449+
e.what());
450+
} catch (...) {
451+
LK_LOG_ERROR("LocalParticipant: failed to send RPC invocation response (invocation_id={}): unknown exception",
452+
invocation_id);
453+
}
443454
}
444455

445456
std::shared_ptr<TrackPublication> LocalParticipant::findTrackPublication(const std::string& sid) const {

0 commit comments

Comments
 (0)