From b9cea63f75bb9b49665fb78db1c2fb065f62cbc2 Mon Sep 17 00:00:00 2001 From: Joseph Birkner Date: Wed, 17 Jul 2024 12:45:30 +0200 Subject: [PATCH] Catch exceptions from load(). --- libs/httpcl/src/http-settings.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libs/httpcl/src/http-settings.cpp b/libs/httpcl/src/http-settings.cpp index 594ea57..ffaa723 100644 --- a/libs/httpcl/src/http-settings.cpp +++ b/libs/httpcl/src/http-settings.cpp @@ -423,7 +423,13 @@ Config Settings::operator[] (const std::string &url) const std::shared_lock lock(mutex); if (lastRead < lastUpdated.load(std::memory_order_relaxed)) { lock.unlock(); - const_cast(this)->load(); + try { + const_cast(this)->load(); + } + catch (...) { + // If an exception occurred during load(), it was already + // logged in all likelihood. + } lock.lock(); }