summaryrefslogtreecommitdiff
path: root/docs/developer/server/errors.md
diff options
context:
space:
mode:
authorOwen Jacobson <owen@grimoire.ca>2025-06-23 22:45:18 -0400
committerOwen Jacobson <owen@grimoire.ca>2025-07-01 20:25:30 -0400
commitc38d877b94c6ac5df2de4c9c939ae683d733e8b8 (patch)
treef8d02380dfef622656710b1412900eb21cc42656 /docs/developer/server/errors.md
parentc0c825477e476d6d7331bfc409bceff9c376b484 (diff)
Organize the developer docs into a "Pilcrow for Developers" book.
The audience for this is developers looking to make changes to Pilcrow, either on the server, on the included client, or via its data model. Most of the material here is drawn from existing documents, but organized somewhat more coherently. I've left some space for client documentation, though no such documents exist yet.
Diffstat (limited to 'docs/developer/server/errors.md')
-rw-r--r--docs/developer/server/errors.md9
1 files changed, 9 insertions, 0 deletions
diff --git a/docs/developer/server/errors.md b/docs/developer/server/errors.md
new file mode 100644
index 0000000..e5cdafb
--- /dev/null
+++ b/docs/developer/server/errors.md
@@ -0,0 +1,9 @@
+# Errors
+
+In general, errors are reported back up as Rust values with full Rust semantics, and are converted to HTTP errors at the last moment (generally via `IntoResponse` implementations on internal error types).
+
+## Errors and HTTP responses
+
+Handlers must make sure that the errors returned to clients over HTTP do not leak information about the server unintentionally. For example, errors due to misconfigured permissions should not cause Pilcrow to start informing clients of the specific filesystem path Pilcrow is configured to look for its database at: that information is not useful to most users, and may be used to attack the service or mislead the operator. To that end, handlers, middleware, response types, and other HTTP-facing components are very explicit about what errors correspond to what responses.
+
+The fallback option, universally, is `crate::error::Internal`, which captures the underlying error and forwards it to standard error, but does not pass it along to HTTP clients. Every intended error is also part of Pilcrow's API documentation.