mirror of
https://github.com/chatmail/core.git
synced 2026-05-07 08:56:30 +03:00
docs: Contributing guidelines for error handling
This commit is contained in:
@@ -86,6 +86,11 @@ For example:
|
|||||||
.with_context(|| format!("Unable to trash message {msg_id}"))
|
.with_context(|| format!("Unable to trash message {msg_id}"))
|
||||||
```
|
```
|
||||||
|
|
||||||
|
All errors should be handled in one of these ways:
|
||||||
|
- With `if let Err() =` (incl. logging them into `warn!()`/`err!()`).
|
||||||
|
- With `.log_err().ok()`.
|
||||||
|
- Bubbled up with `?`.
|
||||||
|
|
||||||
### Logging
|
### Logging
|
||||||
|
|
||||||
For logging, use `info!`, `warn!` and `error!` macros.
|
For logging, use `info!`, `warn!` and `error!` macros.
|
||||||
|
|||||||
Reference in New Issue
Block a user