tc39 / proposal-error-cause

TC39 proposal for accumulating errors

Home Page:https://tc39.es/proposal-error-cause/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Other errors besides Error should probably be able to have causes?

domenic opened this issue · comments

Is there a reason the proposal is restricted to Error? I think TypeErrors and RangeErrors and the like should all be able to have causes.

I’d indeed expect them all to have it, since they all inherit from Error (and an idiomatic implementation of each would call super).

The proposal is started with minimal changes. If adding cause to *Error constructors is generally acceptable, I believe it is a good idea to have them all.