# Errors and warnings

Every response carries an `Errors` array. **Roll back period update** also carries a
`Warnings` array.
An **error** means the request was rejected and nothing was created or changed. A
**warning** does not reject the request, but describes something you should know about,
such as other Class events that a rollback will also reverse.


---

**Which operation returns what**
| Operation | Can return |
|  --- | --- |
| **Period updates** | `API_INVALID_PARAMETER`, `API_INVALID_FINANCIAL_YEAR`, `API_INVALID_FUND_TYPE` |
| **New period update** | `API_PARAMETER_REQUIRED`, `API_PARAMETER_TOO_LONG`, `API_INVALID_DATE`, `API_INVALID_FUND_TYPE`, and Class's period update rules (see below) |
| **Period update detail** | `API_INVALID_FUND_TYPE` |
| **Roll back period update** | `PERIOD_UPDATE_CANNOT_CANCEL_INITIAL`, `PERIOD_UPDATE_NOT_LAST_ACTIVE`, `API_INVALID_FUND_TYPE`, and Class's rollback rules. Warnings: `PERIOD_UPDATE_CLASS_WARNING`, `PERIOD_UPDATE_ALREADY` |

Every operation can also return `API_NOT_AUTHORISED` (401), `API_NOT_FOUND` (404) and
`API_INTERNAL_ERROR` (500).


---

**Request validation**
| Code | Severity | Raised when |
|  --- | --- | --- |
| `API_INVALID_PARAMETER` | Error | **Period updates**: `year` is present but is not a single whole number. This includes an empty value, spaces, decimals and lists such as `2026,2025`. |
| `API_INVALID_FINANCIAL_YEAR` | Error | **Period updates**: `year` is a whole number but is not one of the fund's financial years. |
| `API_PARAMETER_REQUIRED` | Error | **New period update**: `PeriodEndDate` or `Description` is missing, null, empty or only spaces. |
| `API_PARAMETER_TOO_LONG` | Error | **New period update**: `Description` is longer than 250 characters after leading and trailing spaces are removed. |
| `API_INVALID_DATE` | Error | **New period update**: `PeriodEndDate` is not a valid calendar date in `yyyy-MM-dd` format. Dates with a time or time zone are rejected. |
| `API_INVALID_FUND_TYPE` | Error | Any operation: the fund is a Consolidated entity. |



---

**Period update rules**: New period update
Class also checks that the period update can run. A request is rejected with `400` when:
- the period would fall in a financial year that is not open for the fund
- `PeriodEndDate` is not later than the end of the fund's latest active period update
- the fund's latest period update is still `Initial` or `Cancelling`.



---

**Rollback rules**: Roll back period update
| Code | Severity | Raised when |
|  --- | --- | --- |
| `PERIOD_UPDATE_CANNOT_CANCEL_INITIAL` | Error | The period update is still `Initial`. Wait until it is `Processed`, then try again. |
| `PERIOD_UPDATE_NOT_LAST_ACTIVE` | Error | A later active period update exists. Roll that one back first. |
| `PERIOD_UPDATE_CLASS_WARNING` | Warning | Class reports a consequence of the rollback, for example that a related event will also be reversed. The rollback still goes ahead. The same text later appears in the period update's `Messages`. |
| `PERIOD_UPDATE_ALREADY` | Warning | A rollback of this period update is already under way or complete (for example, `Already Cancelling`). Nothing new is queued and the response is still `200`. |

