Function: invokeWithErrorHandlingFactory()

invokeWithErrorHandlingFactory(handleError): (handler, context?, args?) => any

Creates a function factory with error handling capabilities

Parameters

handleError

Fn

Error handling function to process exceptions during execution

Returns

Returns a new function that can execute target functions with automatic error handling

(handler, context?, args?) => any

Example

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') });