mirror of
https://github.com/chatmail/core.git
synced 2026-04-02 05:22:14 +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}"))
|
||||
```
|
||||
|
||||
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
|
||||
|
||||
For logging, use `info!`, `warn!` and `error!` macros.
|
||||
|
||||
Reference in New Issue
Block a user