TritonDataCenter/node-verror

Simplify cause drill down

veselov opened this issue · 1 comments

If I'm understanding things right, nesting errors doesn't change the result of stack property. If one wants to extract causes, especially in a generic function that may get objects of type Error, or VError, one will have to check for presence of cause() (or use instanceof), and extract the causes, printing them in chain.

Wouldn't it be neater if the VError just added the causes's stack to its stack?

I think this is a dup of #23, but let me know if not.