AriaMinaei/pretty-error

Support nesting with cause

Opened this issue · 2 comments

I'm building an application which really needs nested errors. The fs can throw, but in my application just seeing what failed isn't enough to understand what action was being attempted when a failure occurred. Instead I must catch the source error, attach some additional context, and rethrow.

I'd like to be able to attach the original error as a cause. Spec-level support for this is already underway. A shim has been published as well, but while it can get a cause property set up correctly, it doesn't contain any logic about rendering causes. This library has an opportunity to be the first to present such information in a useful way and kickstart the community's ability to use this feature.

I'm going to make a fork and see what I can do.

The only slight problem is that my personal temptation is to hard fork it as I don't know coffeescript and I don't want to.

Supporting cause sounds like a good idea!

As to coffeescript, I'll be happy to merge back TS or ESNext :)