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
- 派生
- 46
- 平均合并
- 20 小时 53 分钟
- 30 天内合并 PR
- 11
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
roc-lang/basic-cli 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
难度 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 天内回复
查看 roc-lang/basic-cli 的全部 Issue
相似的 Issue
-
app enhancement
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 80/100
elodin-sys/elodin#890 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 85/100
guidance-ai/llguidance#391 ·
-
documentation
难度 1/5 1 小时以内 新手友好度 85/100
Verifiedz/Shimmer#144 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
Y-ASLant/ElegantClipboard#166 ·