You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+17-1Lines changed: 17 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,8 @@ An error handling library designed to be:
19
19
- Works with std and no-std, but requires a global allocator. [See example](examples/embedded-no-std.rs).
20
20
- Compatible with non-Send/Sync environments, but also with Send/Sync environments (per feature flag).
21
21
- Out of the box source error chaining.
22
+
- No dependencies by default. Optional features may lead to some dependencies.
23
+
- No `unsafe` used (yet?).
22
24
23
25
## Why a new (German: neuer) error library?
24
26
@@ -44,7 +46,7 @@ provided_attachments!(
44
46
);
45
47
46
48
fndo_something_internal() ->Result<()> {
47
-
Err(CtxError::new("Error occurred internally")
49
+
Err(NeuErr::new("Error occurred internally")
48
50
.attach(Retryable::No))
49
51
}
50
52
@@ -68,6 +70,20 @@ fn main() {
68
70
69
71
Run `cargo add neuer-error` to add the library to your project.
70
72
73
+
## Comparisons
74
+
75
+
### Anyhow / Eyre
76
+
77
+
-`NeuErr` provides a meechanism to discover and retrieve multiple items of typed context information, while `anyhow` can `downcast` to its source error types only.
78
+
-`NeuErr` captures source locations instead of backtraces by default, which is more efficient and works without debug info. I personally also find it easier to read.
79
+
80
+
### Thiserror / Snafu
81
+
82
+
-`NeuErr` is a single error type for all errors, so no need for boilerplate, better ergonomics, but less type safety and flexibility.
83
+
-`NeuErr` captures source location automatically, which `thiserror` does not and `snafu` does only when you add the location field to every error variant.
84
+
-`NeuErr` prints the full (source) error chain already.
85
+
-`NeuErr` does not have procedural macros.
86
+
71
87
## Development
72
88
73
89
If you want to contribute or have questions, feel free to open issues :)
0 commit comments