{% error %}
Attributes
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | ✓ | Unique kebab-case error id (e.g., 'bookmark-not-found') |
code | string | ✓ | Machine-readable SCREAMING_SNAKE_CASE code |
category | enum | — | domain | technical — default is domain |
Valid Parent Contexts
This tag is valid inside: {% api %}
Rules
| Rule | Force | Realm | Reference | Description |
|---|---|---|---|---|
error-code-screaming-snake | | | — | Error codes must be in . |
error-id-descriptive | | | — | Prefer descriptive noun phrases for IDs: ✓, ✗. |
error-body-condition | | | — | The body should describe the failure condition, not how clients should handle it. |
error-category-technical-sparingly | | | — | Use only when the technical condition is a core part of the business contract (e.g., a quota service). |
Declares a named domain error. Defined once per domain and referenced by operations via the throws tag.
Named error definition with code and category
{% api %} {% error id="bookmark-not-found" code="BOOKMARK_NOT_FOUND" category="domain" %} Returned when the requested bookmark does not exist or belongs to a different user. {% /error %}{% /api %}