Make Http.TransportErr match host error behavior
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 5/5
- 預估耗時
- 一週以上
- 新手友好度
- 45/100
研究方向
從 platform/InternalHttp.roc:12 中公開的 TransportErr 宣告和 src/http.rs:167-170 中的請求錯誤轉換開始,接著檢查連線遭拒的整合情境。為列出的每個失敗定義並記錄最終對應,更新測試以斷言各個變體,使文件和範例保持一致,並將任何 API 變更納入 release bump 檢查。
由索引模型根據 Issue 內容生成。
描述
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:
- classify DNS/connect/TLS/socket failures as
NetworkError(details), potentially changing its payload; or - remove
NetworkErrorand define whenOtheris 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
TransportErrvariant 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.
- 主要語言
- Rust
- 星號
- 121
- 分支
- 45
- 平均合併
- 19 小時 1 分鐘
- 30 天內合併 PR
- 16
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
roc-lang/basic-cli 的其他 Issue
-
難度 3/5 1-2 天 新手友好度 45/100
維護者通常 1 天內回覆
-
難度 5/5 一週以上 新手友好度 25/100
維護者通常 1 天內回覆
-
難度 4/5 3-5 天 新手友好度 45/100
維護者通常 1 天內回覆
-
難度 3/5 1-2 天 新手友好度 52/100
維護者通常 1 天內回覆
-
enhancement
難度 5/5 一週以上 新手友好度 45/100
roc-lang/basic-cli#455 · 1 則留言 ·
維護者通常 1 天內回覆
查看 roc-lang/basic-cli 的全部 Issue
相似的 Issue
-
bug CLI exec tool-calls
難度 2/5 1-3 小時 新手友好度 85/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 75/100
-
maintainer-needed p2 triaged ui windows
難度 2/5 1-3 小時 新手友好度 74/100
維護者通常 1 天內回覆
-
ai_p2
難度 2/5 1-3 小時 新手友好度 76/100
ClickHouse/ClickHouse#123351 ·
維護者通常 1 天內回覆
-
documentation
難度 1/5 1 小時以內 新手友好度 92/100
github/copilot-sdk#2804 · 1 則留言 ·
維護者通常 1 天內回覆