From b2b8d89b72cfa5940ba886ac289f6fdc35234616 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Mon, 12 Aug 2024 16:15:50 -0400 Subject: [PATCH] error handling --- lib/datadog/di/probe_notifier_worker.rb | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/datadog/di/probe_notifier_worker.rb b/lib/datadog/di/probe_notifier_worker.rb index c2fe7362bfe..98aa7164dc7 100644 --- a/lib/datadog/di/probe_notifier_worker.rb +++ b/lib/datadog/di/probe_notifier_worker.rb @@ -27,11 +27,15 @@ def start return if defined?(@thread) @thread = Thread.new do loop do - if maybe_send - # Run next iteration immediately in case more work is - # in the queue - else - sleep 1 + begin + if maybe_send + # Run next iteration immediately in case more work is + # in the queue + else + sleep 1 + end + rescue => exc + warn "Error in probe notifier worker: #{exc.class}: #{exc}" end end end