CrabDude / trycatch

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

Stack trace is lost when Error catched inherits from Error base class #52

Open sebpatu opened 5 years ago

sebpatu commented 5 years ago

Hi When we use inheritance for error handling, but also for standard error class like ReferenceError etc..., the stack trace is lost. Its because of function isError in formatError.js check is made with Object.prototype.toString.call(err) === '[object Error]' but it should be err instanceof Error; to take inheritance in account Thanks