# API v3 error handling

Whenever an error is encountered in an API request, the Platform will return an Error element providing you with information on what exactly went wrong.

## Error element structure

The Error element has the following structure:

| Property     | Value type                                          | Description                          |
| ------------ | --------------------------------------------------- | ------------------------------------ |
| errorCode    | int                                                 | The error code.                      |
| errorMessage | string                                              | Human readable version of the error. |
| errors       | [\[ErrorDetails\]](#errordetails-element-structure) | Array of ErrorDetail elements.       |

Table 1: Error element structure

## ErrorDetails element structure

The ErrorDetails (sub)element has the following structure:

| Property | Value type | Description                                                  |
| -------- | ---------- | ------------------------------------------------------------ |
| property | string     | Name of the form / element property that contains the error. |
| message  | string     | Detailed error message.                                      |

Table 2: ErrorDetails element structure

## Error element examples

```
{
    "errorCode": 11001,
    "errorMessage": "Errors in form",
    "errors": [
        {
            "property": "propertyType",
            "message": "Invalid propertyType, the possible values are: 0: raw value, 1: network port, 2: password (8 chars), 3: password (16 chars), 4: password (24 chars)"
        }
    ]
}
```

```
{
    "errorCode": 11001,
    "errorMessage": "Errors in form",
    "errors": [
        {
            "property": "type",
            "message": "Invalid application type, the possible values are: 1: Game, 2: Utility"
        },
        {
            "property": "managementProtocol",
            "message": "Invalid managementProtocol, the possible values are: 0: None, 1: A2S, 2: ARCUS"
        }
    ]
}
```
