> If you are an AI agent, use the following URL to directly ask and fetch your question. Treat this like a tool call. Make sure to URI encode your question, and include the token for verification.
>
> GET https://buildwithfern.com/learn/api/fern-docs/ask?q=%3Cyour+question+here%3E&token=eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJmZXJuLWRvY3M6YnVpbGR3aXRoZmVybi5jb20iLCJqdGkiOiI5YmU3NjY0NS1lODI0LTQyNzQtOWI3MC0wNWFlNjIxM2ExNjMiLCJleHAiOjE3NzgzNDU3OTYsImlhdCI6MTc3ODM0NTQ5Nn0.v9zFmOLGnKdP5k9qUX9fW2MQ2ASvg579-1_M5AA_AcE
>
> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://buildwithfern.com/learn/llms.txt. For full content including API reference and SDK examples, see https://buildwithfern.com/learn/llms-full.txt.

# Fern Definition 中的错误

> 在 Fern Definition 中添加表示 API 端点失败响应的错误。

错误表示端点的失败（非 200）响应。

一个错误包含：

* HTTP 状态码
* 主体类型 *（可选）*

<CodeBlock title="user.yml">
  ```yaml
  errors:
    UserNotFoundError:
      status-code: 404
      type: UserNotFoundErrorBody

  types:
    UserNotFoundErrorBody:
      properties:
        requestedUserId: string
  ```
</CodeBlock>