CrabDude / trycatch

An asynchronous domain-based exception handler with long stack traces for node.js
MIT License
246 stars 17 forks source link

Check if the catchFn is a function #18

Closed AlexeyKupershtokh closed 11 years ago

AlexeyKupershtokh commented 11 years ago

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.

CrabBot commented 11 years ago

https://github.com/CrabDude/trycatch/commit/705884d4f2d40543f3dfbed30876166cefa4a039