Skip to content

Add Error.prototype.cause #47020

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

Merged
merged 3 commits into from
Jan 7, 2022
Merged

Add Error.prototype.cause #47020

merged 3 commits into from
Jan 7, 2022

Conversation

saschanaz
Copy link
Contributor

Fixes #47019

@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Dec 4, 2021
@sandersn sandersn requested review from orta and rbuckton December 16, 2021 21:46
@typescript-bot typescript-bot added For Backlog Bug PRs that fix a backlog bug and removed For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Dec 16, 2021
Copy link
Contributor

@rbuckton rbuckton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good in general, but there are failing tests that need to be addressed.

@saschanaz saschanaz requested a review from rbuckton December 25, 2021 13:59
@orta
Copy link
Contributor

orta commented Jan 7, 2022

Agree, thanks, this all looks good to me too

@orta orta merged commit 363e3a7 into microsoft:main Jan 7, 2022
@saschanaz saschanaz deleted the es2022-errorcause branch January 7, 2022 14:59
jstasiak added a commit to lune-climate/ts-results-es that referenced this pull request Mar 29, 2022
I want to have this in place to implement [1] which satisfies a need we
ourselves have[2]. This is needed because the cause property is only
availble in the es2022 TS profile[3].

[1] vultix#34
[2] vultix#48
[3] microsoft/TypeScript#47020
jstasiak added a commit to lune-climate/ts-results-es that referenced this pull request Mar 29, 2022
I want to have this in place to implement [1] which satisfies a need we
ourselves have[2]. This is needed because the cause property is only
availble in the es2022 TS profile[3].

[1] vultix#34
[2] vultix#48
[3] microsoft/TypeScript#47020
@@ -1,8 +1,55 @@
interface ErrorOptions {
cause?: Error;
cause?: Error;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cause should be typed as unknown (or any in a less strict way) as the value being thrown in JavaScript can be arbitrary values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Backlog Bug PRs that fix a backlog bug
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Error.prototype.cause is still missing with es2022/esnext
5 participants