about summary refs log tree commit diff
path: root/docs/dev
diff options
context:
space:
mode:
Diffstat (limited to 'docs/dev')
-rw-r--r--docs/dev/style.md13
1 files changed, 13 insertions, 0 deletions
diff --git a/docs/dev/style.md b/docs/dev/style.md
index d2a03fba40d..786127639ce 100644
--- a/docs/dev/style.md
+++ b/docs/dev/style.md
@@ -869,6 +869,19 @@ type   -> ty
 
 **Rationale:** consistency.
 
+## Error Handling Trivia
+
+Use `anyhow::Result` rather than just `Result`.
+
+**Rationale:** makes it immediately clear what result that is.
+
+Use `anyhow::format_err!` rather than `anyhow::anyhow`.
+
+**Rationale:** consistent, boring, avoids stuttering.
+
+There's no specific guidance on the formatting of error messages, see [anyhow/#209](https://github.com/dtolnay/anyhow/issues/209).
+Do not end error and context messages with `.` though. 
+
 ## Early Returns
 
 Do use early returns