[blog] Move general comments to separate file

This commit is contained in:
Berkus Decker 2020-11-22 15:49:22 +02:00
parent 15a38d5689
commit ee1b5fc57a
2 changed files with 9 additions and 8 deletions

9
doc/error_handling.md Normal file
View File

@ -0,0 +1,9 @@
The different libraries seem to target different use-cases, though. For example, `snafu` with its
strongly typed errors and contexts seems to be a good fit for libraries. On the other hand,
anyhow with its focus on the type-erased Error and on creating string errors and contexts seems
to be more useful for applications. After all, errors produced by libraries need to be understood
by other code, errors produced by executables need to be understood by humans.
-- https://lukaskalbertodt.github.io/2019/11/14/thoughts-on-error-handling-in-rust.html
@see also https://blog.yoshuawuyts.com/error-handling-survey/
@see also https://www.reddit.com/r/rust/comments/dfs1zk/2019_q4_error_patterns_snafu_vs_errderive_anyhow/

View File

@ -438,14 +438,6 @@ impl CapTableEntry {
}
}
// The different libraries seem to target different use-cases, though. For example, `snafu` with its
// strongly typed errors and contexts seems to be a good fit for libraries. On the other hand,
// anyhow with its focus on the type-erased Error and on creating string errors and contexts seems
// to be more useful for applications. After all, errors produced by libraries need to be understood
// by other code, errors produced by executables need to be understood by humans.
// -- https://lukaskalbertodt.github.io/2019/11/14/thoughts-on-error-handling-in-rust.html
// @see also https://blog.yoshuawuyts.com/error-handling-survey/
// @see also https://www.reddit.com/r/rust/comments/dfs1zk/2019_q4_error_patterns_snafu_vs_errderive_anyhow/
#[derive(Debug)]
pub enum CapError {
CannotCreate,