Exception

group NVCV_CPP_UTIL_EXCEPTION

Functions

inline void SetThreadError(std::exception_ptr e)

Sets the thread’s error status based on a captured exception.

This function tries to rethrow the given exception and based on its type, it sets the appropriate error status for the current thread using the nvcvSetThreadStatus function.

Parameters:

e – The captured exception to be rethrown and processed.

template<class F>
NVCVStatus 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 the SetThreadError 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.

class Exception : public std::exception
#include <Exception.hpp>

Custom exception class to represent errors specific to this application.

This class extends the standard exception class and is designed to encapsulate error codes and messages specific to this application’s context.