# Retry Notification

Documentation owner: product `control`; documentation version: `1.3.0`.
Source: `content/products/control/1.3.0/key-components/forms/step/retry-notification.mdx` at commit `eaf7a020437971baeee95e87eaf963636040ac71`.

A retry notification is shown when a Step Pipe fails and the user may be able to correct the input or retry the Step. It can show a generic error message or map backend errors to more specific messages.

The notification can also show the request `trace_id`, which helps administrators connect the user-facing error with backend logs.

### Properties

| Name                     | Description                                                       | Default                   | Mandatory |
| ------------------------ | ----------------------------------------------------------------- | ------------------------- | --------- |
| `document_title`         | Translation key or text for the notification title                | `forms.retry.title`       | No        |
| `description`            | Translation key or Markdown text for the notification description | `forms.retry.description` | No        |
| `restart_button`         | Restart button configuration                                      | Visible with defaults     | No        |
| `restart_button.enabled` | Show the restart button                                           | `true`                    | No        |
| `restart_button.text`    | Translation key or text for the restart button                    | `forms.retry.restart`     | No        |
| `retry_button`           | Retry button configuration                                        | Visible with defaults     | No        |
| `retry_button.enabled`   | Show the retry button                                             | `true`                    | No        |
| `retry_button.text`      | Translation key or text for the retry button                      | `forms.retry.button`      | No        |
| `error_mappings`         | Error message mappings evaluated against the backend error        | `[]`                      | No        |
| `error_mappings.pattern` | Regular expression matched against the backend error message      | N/A                       | No        |
| `error_mappings.message` | Translation key or text shown when the pattern matches            | N/A                       | No        |

### Error mappings example

```json
{
  "error_mappings": [
    {
      "pattern": "LDAP.*failed.*",
      "message": "forms.errors.ldap.connection_failed"
    },
    {
      "pattern": "User.*not found",
      "message": "forms.errors.user.not_found"
    },
    {
      "pattern": ".*timeout.*",
      "message": "forms.errors.general.timeout"
    }
  ]
}
```

### Restart only example

```json
{
  "document_title": "forms.retry.title",
  "description": "forms.retry.description",
  "retry_button": {
    "enabled": false
  },
  "restart_button": {
    "enabled": true,
    "text": "forms.retry.restart"
  }
}
```

## Custom error messages from Pipes

A Pipe can return or raise a specific error message that the retry notification maps to a user-friendly text. One common pattern is to use a failing Valve with a configured message.

```json
{
  "name": "FlowFail",
  "exec_if_expr": "request.lastName == null",
  "config": {
    "label": "Validate last name",
    "message": "forms.create_user.errors.last_name_required"
  }
}
```

Use retry notifications for errors the user may be able to fix. Use an [Incomplete step](/products/control/key-components/forms/step/incomplete-step/) when the Flow should stop instead.
