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

Pass original error and add url on timeout error #45

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mgronblad
Copy link
Contributor

Changes the error message of timeout errors to include the url triggering the timeout. Also adds the original got-error as the cause when throwing a timeout error.

In addition, the error message no longer mentions ESOCKETTIMEDOUT. I changed this because I think it's misleading, considering that got no longer seems to have that specific error code anywhere (did it ever? Seems likely that it might be a leftover from when we used the request library). In order to find out where in the request process the timeout occured the got error includes a timings property that reveals this.

The change of error message is potentially breaking for code that acts on the error message, but I could only see a handful of instances where this is the case. However, the most important thing to me is that the url that timeouts is revealed in the error somehow. I'm open to discussing the other changes.

@mgronblad mgronblad requested a review from a team as a code owner September 27, 2022 08:24
@mgronblad mgronblad requested a review from paed01 September 27, 2022 08:25
Copy link
Contributor

@paed01 paed01 left a comment

Choose a reason for hiding this comment

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

We could make a major release of this.

@paed01
Copy link
Contributor

paed01 commented Sep 27, 2022

Perhaps it is possible to drop the VError dependency all together?

@markusn
Copy link
Contributor

markusn commented Sep 29, 2022

Perhaps it is possible to drop the VError dependency all together?

In 1 month node 18 becomes LTS which supports something similar to VError (chaining using cause), so at that time we will remove VError and bump the major !

@Daghall
Copy link
Contributor

Daghall commented Feb 7, 2024

@mgronblad, is this still relevant?

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.

4 participants