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

Support custom Error subclass in the TypeScript types #13

Merged
merged 5 commits into from
Aug 21, 2020

Conversation

gr2m
Copy link
Contributor

@gr2m gr2m commented Aug 16, 2020

First of all thanks for the great library! We use it in semantic-release and love it!

I'm now looking into using it in @octokit/webhooks in order to address octokit/webhooks.js#182

We use a custom Error type for request errors, which are the most common error types in webhook event handlers, so I'd like to provide better intellisense when users interact with the errors from the AggregatedError array. In order to make that possible, the Error type used by would need to be customizeable. That's what I do in this pull request.

Sorry for not opening an issue first, I figured it would be easier to reason about the implementation details in a pull request

index.d.ts Outdated Show resolved Hide resolved
@gr2m gr2m force-pushed the support-custom-error-type branch from 0e53d43 to 9d83bee Compare August 16, 2020 19:13
@gr2m
Copy link
Contributor Author

gr2m commented Aug 16, 2020

Don't do unrelated changes

fixed

index.test-d.ts Outdated Show resolved Hide resolved
@sindresorhus sindresorhus changed the title TypeScript: support custom Error type Support custom Error subclass in the TypeScript types Aug 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants