From 7a79a527dc6db49e5662a9b60a2f929426e0358c Mon Sep 17 00:00:00 2001 From: ww24 Date: Sun, 5 Jul 2026 20:57:21 +0900 Subject: [PATCH] Clarify that ForbiddenError custom messages are not included in API responses --- docusaurus/docs/cms/error-handling.md | 4 ++++ docusaurus/static/llms-code.txt | 4 ++++ docusaurus/static/llms-full.txt | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/docusaurus/docs/cms/error-handling.md b/docusaurus/docs/cms/error-handling.md index e6cb5e449f..5c0fbc95ad 100644 --- a/docusaurus/docs/cms/error-handling.md +++ b/docusaurus/docs/cms/error-handling.md @@ -414,6 +414,10 @@ The `ForbiddenError` class is a specific error class used when a user either doe throw new errors.ForbiddenError('Ah ah ah, you didn\'t say the magic word'); ``` +:::note +The custom `message` passed to `ForbiddenError` is not included in the API response. Instead, the API returns the default message. If you need to return a custom error message indicating insufficient permissions, use [`PolicyError`](#policies) instead. +::: + diff --git a/docusaurus/static/llms-code.txt b/docusaurus/static/llms-code.txt index 18c54f004c..9f5f7b9538 100644 --- a/docusaurus/static/llms-code.txt +++ b/docusaurus/static/llms-code.txt @@ -22366,6 +22366,10 @@ File path: N/A ``` +:::note +The custom `message` passed to `ForbiddenError` is not included in the API response. Instead, the API returns the default message. If you need to return a custom error message indicating insufficient permissions, use [`PolicyError`](#policies) instead. +::: + diff --git a/docusaurus/static/llms-full.txt b/docusaurus/static/llms-full.txt index aaed22e3c7..f945d57e84 100644 --- a/docusaurus/static/llms-full.txt +++ b/docusaurus/static/llms-full.txt @@ -29697,6 +29697,10 @@ The `ForbiddenError` class is a specific error class used when a user either doe throw new errors.ForbiddenError('Ah ah ah, you didn\'t say the magic word'); ``` +:::note +The custom `message` passed to `ForbiddenError` is not included in the API response. Instead, the API returns the default message. If you need to return a custom error message indicating insufficient permissions, use [`PolicyError`](#policies) instead. +::: + The `UnauthorizedError` class is a specific error class used when a user doesn't have the proper role or permissions to perform a specific action, but has properly authenticated. It accepts the following parameters: | Parameter | Type | Description | Default |