Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

Make Http.TransportErr match host error behavior

Offen
#438 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Anfängerfreundlichkeit
45/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Ruhig
Tech-Stack
rust

Rechercherichtung

Beginne mit der öffentlichen TransportErr-Deklaration in platform/InternalHttp.roc:12 und der Konvertierung von Request-Fehlern in src/http.rs:167-170; untersuche anschließend das Integration-Szenario für eine abgelehnte Verbindung. Definiere und dokumentiere die endgültige Zuordnung für jeden aufgeführten Fehler, aktualisiere die Tests, um die Varianten zu bestätigen, gleiche Dokumentation und Beispiele ab und nimm jede API-Änderung in die Prüfung des Release-Bumps auf.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

bug

Context

InternalHttp.TransportErr declares:

[Timeout, NetworkError, BadBody, Other(List(U8))]

in platform/InternalHttp.roc:12.

The Rust host constructs Timeout, BadBody, and Other, but never constructs NetworkError. Every error returned by client.request(request).await is converted to Other(err.to_string().as_bytes()) at src/http.rs:167-170.

The connection-refused integration scenario currently demonstrates this behavior: it produces HttpErr(Other(... "client error (Connect)" ...)).

This is related to #142, which was closed because error details are now retained in Other. The remaining problem is that the public union still advertises an unreachable NetworkError variant.

Suggested direction

Choose and document one consistent contract:

  1. classify DNS/connect/TLS/socket failures as NetworkError(details), potentially changing its payload; or
  2. remove NetworkError and define when Other is used.

Prefer stable structured categories over matching Hyper's display strings. Preserve useful diagnostic details without making callers parse text to identify ordinary network failures.

Acceptance criteria

  • Every public TransportErr variant has a documented, reachable meaning, or unreachable variants are removed.
  • Connection refused, DNS failure, TLS failure, timeout, invalid response body, and request-construction failure are mapped intentionally.
  • Tests assert error variants, not only that an HTTP request failed.
  • Documentation and examples reflect the final error shape.
  • Any API change is included in the release bump check.
Vorherrschende Sprache
Rust
Sterne
122
Forks
47
Ø Merge
12 Std. 20 Min.
Gemergte PRs (30 T.)
18

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus roc-lang/basic-cli

Alle Issues in roc-lang/basic-cli

Ähnliche Issues

Weitere Issues zu Rust

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.