-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for the new native Error.cause prop #90
Comments
If it helps at all, the types appear to be compatible in newer TS versions microsoft/TypeScript#50583 -- however I doubt any tooling will consider invoking the Tbh, I tend to think
It might be worth creating a new version (or new package?) which:
|
I have done a bit of work on creating a more modern successor of verror here: https://github.com/jdpnielsen/contextual-error. I would very much like to collaborate on improving this - or starting a new project based on community needs. |
My ponyfill for Error Causes includes helpers with backwards compatibility for VError causes, enabling one to iteratively move from VError to a more standardized solution: https://github.com/voxpelli/pony-cause |
Especially when using
verror
with@types/verror
you'll quickly run into the issue of VError.prototype.cause (a function) conflicting with the new Error.prototype.cause (Error obj) API, that is already at stage 4 and thus not going anywhere - https://github.com/tc39/proposal-error-causeAre there any plans to make this library (and afterwards - its TS types) compatible with this new API? VError should ditch the
cause
function from the VError prototype, so that it doesn't conflict with the Error.prototype.cause type, and move this function to another name. This new function should also understand how to read both VError style 'cause' values and native Error style 'cause' values.The text was updated successfully, but these errors were encountered: