Skip to content

net: Add warning log for failed HTTP requests.#40093

Merged
jdm merged 1 commit intomainfrom
jdm-patch-58
Oct 23, 2025
Merged

net: Add warning log for failed HTTP requests.#40093
jdm merged 1 commit intomainfrom
jdm-patch-58

Conversation

@jdm
Copy link
Copy Markdown
Member

@jdm jdm commented Oct 23, 2025

We currently lose information when there are connection issues with HTTP requests. Until we figure out a better architecture for exposing error data from crates that we don't control, we can at least log messages like WARN net::http_loader] network error: hyper_util::client::legacy::Error(Connect, Custom { kind: Other, error: Custom { kind: InvalidData, error: AlertReceived(HandshakeFailure) } }.

Testing: Manually confirmed console output for fsf.org with RUST_LOG=net.

@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Oct 23, 2025
)))
})
.map_err(move |error| {
warn!("network error: {error:?}");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm curious why is it warn! instead of error!.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I tend to use error! for things that are wrong in the engine, and warn! for things that are possible but worth highlighting when reading debug logs.

@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Oct 23, 2025
@jdm jdm added this pull request to the merge queue Oct 23, 2025
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Oct 23, 2025
Merged via the queue into main with commit 1fca820 Oct 23, 2025
33 checks passed
@jdm jdm deleted the jdm-patch-58 branch October 23, 2025 06:09
@servo-highfive servo-highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Oct 23, 2025
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.

3 participants