Error handling function to process exceptions during execution
Returns a new function that can execute target functions with automatic error handling
Optional context: unknownOptional args: unknown[]const errorHandler = (error) => console.error(error);
const safeExecute = invokeWithErrorHandlingFactory(errorHandler);
// Execute regular function
safeExecute(() => { throw new Error('test') });
// Execute async function
safeExecute(async () => { throw new Error('async test') });
Creates a function factory with error handling capabilities