Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update errors.md #1490

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/advance/errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -685,8 +685,6 @@ fn render() -> Result<String> {
}
```

关于如何选用 `thiserror` 和 `anyhow` 只需要遵循一个原则即可:**是否关注自定义错误消息**,关注则使用 `thiserror`(常见业务代码),否则使用 `anyhow`(编写第三方库代码)。

## 总结

Rust 一个为人津津乐道的点就是强大、易用的错误处理,对于新手来说,这个机制可能会有些复杂,但是一旦体会到了其中的好处,你将跟我一样沉醉其中不能自拔。