The function to execute. Can be synchronous or return a Promise.
The value to return if an error occurs.
Optionallogger: ILoggingAgentOptional logger that implements a Warn(error) method.
The function's result if successful, otherwise the fallback value.
Safely executes a function and catches any exceptions or promise rejections.
fallbackvalue is returned instead.loggeris provided, any caught exception is logged usinglogger.Warn(error).