From db47135b8b1222ae4bf860bfa945389f4bc134fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Valais?= Date: Mon, 6 Jan 2025 16:50:38 +0100 Subject: [PATCH] Update _index.en.md --- .../docs/reference/design-docs/editoast-errors/_index.en.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/content/docs/reference/design-docs/editoast-errors/_index.en.md b/content/docs/reference/design-docs/editoast-errors/_index.en.md index 51b39ad0d..f733b1204 100644 --- a/content/docs/reference/design-docs/editoast-errors/_index.en.md +++ b/content/docs/reference/design-docs/editoast-errors/_index.en.md @@ -227,7 +227,9 @@ enum MyError { ### Providing `context` -Only `4xx` errors require context since these are the errors the frontend may use to provide the user some form of recovery. Context is computed just before the error is serialized in `axum`'s error handler. +Context is computed just before the error is serialized in `axum`'s error handler. + +Note: it shouldn't be used in `editoast` as we now have enums variants we can `match` on. The `context` response field is meant to provide data potentially useful to the frontend so that it may perform some kind of error recovery. `derive(ViewError)` provides a few ways to set it.