UHD 003.004.000-release
|
Go to the source code of this file.
Defines | |
#define | _UHD_SAFE_CALL_WARNING(code, what) |
helper macro for safe call to produce warnings | |
#define | UHD_SAFE_CALL(code) |
#define _UHD_SAFE_CALL_WARNING | ( | code, | |
what | |||
) |
UHD_LOGV(rarely) << \ UHD_THROW_SITE_INFO("Exception caught in safe-call.") + #code + " -> " + what \ ;
helper macro for safe call to produce warnings
#define UHD_SAFE_CALL | ( | code | ) |
try{code} \ catch(const std::exception &e){ \ _UHD_SAFE_CALL_WARNING(code, e.what()); \ } \ catch(...){ \ _UHD_SAFE_CALL_WARNING(code, "unknown exception"); \ }
A safe-call catches all exceptions thrown by code, and creates a verbose warning about the exception. Usage: UHD_SAFE_CALL(some_code_to_call();)
code | the block of code to call safely |