# Errors in Fern Definition

> Add errors representing failed responses from API endpoints in Fern Definition.

Errors represent failed (non-200) responses from endpoints.

An error has:

* An HTTP status code
* A body type *(Optional)*

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

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