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

fix(ext/fetch): include TCP src/dst socket info in error messages #24939

Merged

Conversation

magurotuna
Copy link
Member

@magurotuna magurotuna commented Aug 8, 2024

This commit makes fetch error messages include source and destination TCP socket info i.e. port number and IP address for better debuggability.

Closes #24922


Demo

Here's an example error message:

$ ./target/debug/deno eval 'await fetch("http://localhost:4444")'
error: Uncaught (in promise) TypeError: error sending request from 127.0.0.1:55985 for http://localhost:4444/ (127.0.0.1:4444): client error (SendRequest): connection closed before message completed
await fetch("http://localhost:4444")
^
    at async mainFetch (ext:deno_fetch/26_fetch.js:170:12)
    at async fetch (ext:deno_fetch/26_fetch.js:392:7)
    at async file:///Users/yusuke/Repo/github.com/magurotuna/deno/$deno$eval:1:1

Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

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

LGTM, nice improvement!

@magurotuna magurotuna merged commit e36b1a3 into denoland:main Aug 8, 2024
17 checks passed
@magurotuna magurotuna deleted the magurotuna/tcp-conn-info-on-error-2 branch August 8, 2024 15:47
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.

Show TCP connection info on fetch errors
2 participants