aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2024-02-16 15:15:46 +0100
committerAki Tomita <121511582+atomita-ni@users.noreply.github.com>2024-02-25 16:55:16 -0600
commiteb557fa2881d4cf89bd15673b4c3e92a3264dc6f (patch)
treedfb922288e701baf0f9e9227f5c1c6ac2920d3dc
parentci: Use rfnoc_image_builder in FPGA pipelines (diff)
downloaduhd-eb557fa2881d4cf89bd15673b4c3e92a3264dc6f.tar.xz
uhd-eb557fa2881d4cf89bd15673b4c3e92a3264dc6f.zip
uhd: Demote safe call logging to warning
When catching an exception in UHD_SAFE_CALL(), a log message is emitted. This patch changes the log level from ERROR to WARNING. The rationale is that when we are using UHD_SAFE_CALL, we must have already made the decision that an exception is not fatal. Note that UHD_SAFE_CALL() is most commonly used in destructors, where throwing exceptions will cause crashes when the stack is already being unrolled due to a previous exception, and therefore usage of UHD_SAFE_CALL() is mandatory. However, even in those cases, logging a WARNING rather than an ERROR is the better default. If an exception is throw during a destructor that must truly be handled differently, more sophisticated measures must be taken than using UHD_SAFE_CALL().
-rw-r--r--host/include/uhd/utils/safe_call.hpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/host/include/uhd/utils/safe_call.hpp b/host/include/uhd/utils/safe_call.hpp
index f19a0926a..a52e88764 100644
--- a/host/include/uhd/utils/safe_call.hpp
+++ b/host/include/uhd/utils/safe_call.hpp
@@ -12,9 +12,9 @@
#include <uhd/utils/log.hpp>
//! helper macro for safe call to produce warnings
-#define _UHD_SAFE_CALL_WARNING(code, what) \
- UHD_LOGGER_ERROR("UHD") << UHD_THROW_SITE_INFO("Exception caught in safe-call.") \
- + #code + " -> " + what;
+#define _UHD_SAFE_CALL_WARNING(code, what) \
+ UHD_LOGGER_WARNING("UHD") << UHD_THROW_SITE_INFO("Exception caught in safe-call.") \
+ + #code + " -> " + what;
/*!
* A safe-call catches all exceptions thrown by code,