Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Make Http.TransportErr match host error behavior

Aperta
#438 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
rust

Direzione di ricerca

Inizia con la dichiarazione pubblica di TransportErr in platform/InternalHttp.roc:12 e la conversione degli errori di richiesta in src/http.rs:167-170, quindi esamina lo scenario di integrazione per la connessione rifiutata. Definisci e documenta la mappatura finale per ogni errore elencato, aggiorna i test per verificare le varianti, allinea la documentazione e gli esempi e includi qualsiasi modifica all’API nel controllo del bump di release.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.
Lingua principale
Rust
Stelle
121
Fork
45
Merge medio
19h 1m
PR unite (30g)
16

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di roc-lang/basic-cli

Tutte le issue di roc-lang/basic-cli

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.