Skip to content
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

Set Error.prototype.cause type to unknown (#70) #49639

Merged
merged 1 commit into from
Jul 5, 2022

Conversation

iamharbie
Copy link
Contributor

@iamharbie iamharbie commented Jun 22, 2022

Describe your changes
This PR fixes #45167 which changes the type of Error.prototype.cause from Error to Unknown

Testing performed
I added new tests to ensure that unknown type is recognised

Additional context
Could also potentially resolve #48098. @DanielRosenwasser's suggested being more restrictive with the type of the cause property of the options param. I am open to discussions on this.

Fixes #45167

Credits to Bloomberg colleagues who helped with reviews @mkubilayk @dragomirtitian

Signed-off-by: Abdul-Azeez Lawal <abdul-azeez.lawal@outlook.com>
@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Jun 22, 2022
@typescript-bot
Copy link
Collaborator

This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise.

@ghost
Copy link

ghost commented Jun 22, 2022

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.

❌ iamharbie sign now
You have signed the CLA already but the status is still pending? Let us recheck it.

@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 Jun 22, 2022
Copy link

@voxpelli voxpelli left a comment

Choose a reason for hiding this comment

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

This is a good change. Would fix voxpelli/pony-cause#35

@voxpelli
Copy link

@iamharbie @mkubilayk @dragomirtitian What's needed to get the CLA signed? My guess is that Bloomberg already has a signed CLA, just that @iamharbie hasn't been added to it and thus that the bot doesn't pick it up?

@voxpelli
Copy link

Oh, apparently the Bloomberg CLA thing is being worked on by @RyanCavanaugh: #49675 (comment)

@iamharbie iamharbie closed this Jul 5, 2022
@iamharbie iamharbie reopened this Jul 5, 2022
@RyanCavanaugh RyanCavanaugh merged commit 1f0d0f7 into microsoft:main Jul 5, 2022
@DanielRosenwasser DanielRosenwasser added the Breaking Change Would introduce errors in existing code label Jul 11, 2022
typescript-bot pushed a commit to DefinitelyTyped/DefinitelyTyped that referenced this pull request Jul 20, 2022
…error` on TS `4.8` by @voxpelli

This commit fixes the following error, which appears when running TS `^4.8.0-dev.20220707` with eg. ` npx tsc --lib es2020,es2022.error,es2021.promise` or ` npx tsc --lib esnext`

> error TS2425: Class 'Error' defines instance member property 'cause', but extended class 'VError' defines it as instance member function.

Discovered in voxpelli/pony-cause#41 when looking to extend the tests for voxpelli/pony-cause#35 to detect whether the nightly of `4.8.0` now correctly fixes that, following the merge of microsoft/TypeScript#49639
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Breaking Change Would introduce errors in existing code For Backlog Bug PRs that fix a backlog bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error.prototype.cause has inaccurate value type TC39 proposal - Error.cause property
6 participants