-
-
Notifications
You must be signed in to change notification settings - Fork 365
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 cause
to TimeoutError
#593
Conversation
The CI fails on TypeScript not knowing of this property. Locally I see this defined in I believe that this second parameter to the Error constructor will be simply ignored by older runtimes, so there should be no danger in adding it. What would be your preferred way of handling this error in Ky project? |
I think it would be more correct to attach the URL as a property on the error. The URL is not really the "cause" of the error. |
Thank you for the quick response! I see your point, that’s fair enough. I understand that you wouldn’t want to have this in the core. Personally, I’ll still use |
Not sure what you mean by this, but adding properties to errors has always been the way to add metadata. |
It was, but only the |
The URL alone doesn't seem like a good use of I would be okay with either or both of the following:
|
While it is acceptable to use
Let's do this. I tried doing a Twitter poll for this, but it ended up being inconclusive: https://x.com/sindresorhus/status/1803812187758080325 |
Closing in favor of PR #595 @arty-name what do you think of that solution? |
@sholladay This solution will also resolve my issue, thank you! |
Fixes #592
This is the simplest approach we could take