Study note

Stop forwarding errors, start designing them

Properties

Type
Blogs
Status
待读
Domain
Blogs / Newsletters
Category
技术博客与资料索引
Source
fast.github.io
Vault note
library/articles/blogs/Stop-forwarding-errors,-start-designing-them-252f44c67c8c5604.md

Summary

FastLabs 关于错误设计的文章,主张不要只把错误链层层转发,而要按调用方“能采取什么行动”来设计错误类型、错误状态和上下文,例如区分 NotFound、RateLimited、Temporary、Permanent 等语义。

Highlights

适合和 Rust/后端错误处理规范一起读,重点学习如何把错误从“日志字符串”设计成可重试、可观测、可决策的 API 契约。

Notes

错误设计

Comments

Loading comments...