Skip to content

show detailed error types instead of generic HTTP errors #8

@GabrielTecuceanu

Description

@GabrielTecuceanu

When a request fails, httpress currently wraps all transport errors intoError::Http(hyper_error). This means Connection Refused, TLS handshake failure, DNS resolution error all look the same in the output. We should classify errors more specifically so users can diagnose problems faster.

error variants to add:

  • ConnectionRefused
  • DnsError
  • TlsError
  • ConnectionReset
  • Timeout
  • Other(String) - catch-all

And surface these in the CLI summary output (currently only error counts are shown, not types).

Relevant files:

  • src/error.rs - add new variants here
  • src/client.rs - classify errors here (look at the execute function)
  • src/metrics.rs - optionally track error type counts
  • src/main.rs - print breakdown in CLI output

you might want to take a look at hyper::Error (especially the .source() function)

notes:

  • you can open a pr even if only part of the errors are added, but make sure you add the catch all Other(String)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions