It's probably better to throw an exception if a catchFn argument passed is not a function (at trycatch() call time). Otherwise it can lead to an app crashing later, if an exception from within the tryFn is thrown.
Another option could be just to make exceptions silent in this case, but I think this is not desired behavior.
It's probably better to throw an exception if a catchFn argument passed is not a function (at trycatch() call time). Otherwise it can lead to an app crashing later, if an exception from within the tryFn is thrown.
Another option could be just to make exceptions silent in this case, but I think this is not desired behavior.