File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
modules/contributor/pages Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -203,10 +203,16 @@ enum Error {
203
203
204
204
=== Choice of error crate and usage
205
205
206
- We use `snafu` for all error handling in library *and* application code.
206
+ We use `snafu` for all error handling in library *and* application code because we want to provide as much context to the user as possible.
207
+ Further, `snafu` allows us to use the same source error in multiple error variants.
208
+ This feature can be used for cases were we need / require more fine-grained error variants.
209
+ This behaviour is not possible when using `thiserror`, as it uses the `From` trait to convert the source error into an error variant.
210
+
207
211
Additionally, we restrict the usage of the `#[snafu(context(false))]` atrribute on error variants.
208
212
This ensures that fallible functions need to call `.context()` to pass the error along.
209
213
214
+ The usage of `thiserror` is considered invalid.
215
+
210
216
[WARNING.code-rule,caption=Examples of incorrect code for this rule]
211
217
====
212
218
You can’t perform that action at this time.
0 commit comments