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

Add types for error constructors #483

Merged
merged 1 commit into from
Apr 14, 2022

Conversation

mthadley
Copy link
Contributor

I was recently writing some tests for handling errors from openid-client and while attempting to instantiate one of the errors, I noticed that the constructor types don't match the implementation.

Since the types don't explicitly declare a constructor, they inherit they inherit it from Error, which doesn't match their overloaded constructors.

So, I tried adding what I think are roughly the correct constructor types for the OPError and RPError classes. I saw that there is a openid-client-tests.ts file, so let me know if there's anything additional I should add there as well. Or, feel free to push any additional updates that you see fit to this branch.

Thanks!

@panva panva merged commit 9505cba into panva:main Apr 14, 2022
@panva
Copy link
Owner

panva commented Apr 14, 2022

Thank you @mthadley

@mthadley mthadley deleted the update-error-constructor-types branch April 14, 2022 15:59
@github-actions github-actions bot locked and limited conversation to collaborators Jul 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants