Conversation
`main` prints an error's `Display`, so the five alphaXiv request sites
reported only reqwest's own wrapper:
Could not reach alphaXiv at https://api.alphaxiv.org: error sending
request for url (...)
The actionable detail always lives in `source()` — a refused connection,
a DNS failure, or `invalid peer certificate: UnknownIssuer` behind a
TLS-inspecting proxy. None of it reached the user, so a network failure
could not be diagnosed without attaching a debugger or writing a probe
binary against the same client.
Add `transport_error`, which walks `source()` and appends each distinct
cause to the message. An `anyhow` context layer alone would not work
here: that detail is only rendered by `{:#}`, and the entry point uses
`{}`.
Message prefixes are unchanged, so existing output is a strict subset of
the new output.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related to #402.
The five alphaXiv request sites in
src/client.rsreport only reqwest's ownwrapper, so a network failure arrives with no usable detail:
The actionable part is always one or two levels down
source()— a refusedconnection, a DNS failure, or
invalid peer certificate: UnknownIssuerbehinda TLS-inspecting proxy. None of it reaches the user today.
This is not a theoretical gap. Diagnosing a TLS trust failure against this
client currently requires attaching a debugger or writing a separate probe
binary, because the one string the CLI prints is identical for every possible
transport failure.
Change
Adds
transport_error, which walks thesource()chain and appends eachdistinct cause to the message, and routes the five
map_errsites through it.A plain
.context(…)layer does not solve this:anyhowonly renders contextchains under
{:#}, andmainprints{}(src/main.rs:912, documented atthe top of
src/error.rs). Flattening the chain into the message keeps thatentry-point contract untouched.
Before:
After:
Message prefixes are unchanged, so existing output is a strict subset of the
new output and nothing that matches on the old text breaks.
Notes
parent do not produce repeated text.
transport_error_includes_the_source_chain),using a connection to reserved port 1 to produce a real nested error rather
than a synthetic one.
Verification
cargo fmt --check— cleancargo clippy --all-targets -- -D warnings— cleancargo test --bin orx— 890 passed, 0 failed, 2 ignoredA few tests in
local::native_store::opencode_databaseandjobs::localboxfail intermittently under full-suite concurrency (roughly one run in two, and
not always the same test). They do the same on an unmodified
ecc531echeckout, so they are pre-existing and unrelated to these changes — noted here
only so a red run is not mistaken for a regression.
(The crate is binary-only, so
cargo test --libreports no library targets;--bin orxis the working invocation.)