Skip to content

Commit 7a79a52

Browse files
committed
Clarify that ForbiddenError custom messages are not included in API responses
1 parent a1571d8 commit 7a79a52

3 files changed

Lines changed: 12 additions & 0 deletions

File tree

docusaurus/docs/cms/error-handling.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,10 @@ The `ForbiddenError` class is a specific error class used when a user either doe
414414
throw new errors.ForbiddenError('Ah ah ah, you didn\'t say the magic word');
415415
```
416416

417+
:::note
418+
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.
419+
:::
420+
417421
</TabItem>
418422

419423
<TabItem value="Unauthorized" label="Unauthorized">

docusaurus/static/llms-code.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22366,6 +22366,10 @@ File path: N/A
2236622366

2236722367
```
2236822368

22369+
:::note
22370+
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.
22371+
:::
22372+
2236922373
</TabItem>
2237022374

2237122375
<TabItem value="Unauthorized" label="Unauthorized">

docusaurus/static/llms-full.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29697,6 +29697,10 @@ The `ForbiddenError` class is a specific error class used when a user either doe
2969729697
throw new errors.ForbiddenError('Ah ah ah, you didn\'t say the magic word');
2969829698
```
2969929699

29700+
:::note
29701+
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.
29702+
:::
29703+
2970029704
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:
2970129705

2970229706
| Parameter | Type | Description | Default |

0 commit comments

Comments
 (0)