Template Function nvcv::ProtectCall
Defined in File Exception.hpp
Function Documentation
-
template<class F>
NVCVStatus nvcv::ProtectCall(F &&fn) Safely executes a function, capturing and setting any exceptions that arise.
This function acts as a wrapper to safely execute a given function or lambda (
fn
). If the function throws any exception, the exception is captured, and the error status is set for the current thread using theSetThreadError
function.- Parameters:
fn – The function or lambda to be executed.
- Template Parameters:
F – The type of the function or lambda.
- Returns:
NVCV_SUCCESS if
fn
executed without exceptions, otherwise the error code from the caught exception.