callSafe
[ Function ]
public static callSafe<T extends object, A extends any[]>(
callback: Callback.ICallback<T, A> | null | undefined,
thisArg: T | null | undefined,
...args: A
): Error | undefined;
Calls a callback function in a safe way and returns an error object in case of an exception.
Parameter
Name | Type | Description |
---|---|---|
callback | The callback function to be called | |
thisArg | This pointer to an object that is to be passed as caller. | |
…args | A | Arguments to be passed to the callback function. |
Return value
Type | Description |
---|---|
Error | undefined | Returns undefined or the error object of an exception. |
Available from version 1.10 |