From 3bb7c5fddbe7545b2051d3503fd7ecc095443036 Mon Sep 17 00:00:00 2001 From: tomdeblauwe Date: Wed, 4 Feb 2026 13:52:43 +0100 Subject: [PATCH] Less Strict throwing of runtime error While encoding, sometimes there can be a timeout in the compressionWorker but actually, it's not that anything is broken, it's just that the system is very busy at startup. So throwing a runtime error is too much because there no possible option to disable it, or catch it: a try catch around the encode function won't do it because it is in another thread when using compression. Signed-off-by: tomdeblauwe --- cloudini_lib/src/cloudini.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cloudini_lib/src/cloudini.cpp b/cloudini_lib/src/cloudini.cpp index 1918cbc..47b67d7 100644 --- a/cloudini_lib/src/cloudini.cpp +++ b/cloudini_lib/src/cloudini.cpp @@ -463,7 +463,7 @@ void PointcloudEncoder::compressionWorker() { lock, std::chrono::seconds(1), [this] { return has_data_to_compress_ || should_exit_; }); if (!ret) { - throw std::runtime_error("Timeout waiting for data to compress. Report this issue"); + std::cerr << "Timeout waiting for data to compress. Report this issue" << std::endl; } if (should_exit_) { @@ -525,7 +525,7 @@ void PointcloudEncoder::waitForCompressionComplete() { std::unique_lock lock(mutex_); auto ret = cv_done_compressing_.wait_for(lock, std::chrono::seconds(1), [this] { return compression_done_; }); if (!ret) { - throw std::runtime_error("Timeout waiting for compression to complete. Report this issue"); + std::cerr << "Timeout waiting for compression to complete. Report this issue" << std::endl; } }