# Error Object

## Description

When errors occur, the Skeddly API will return a model with the following properties:

## Properties

### errorCode

[Error code](https://github.com/skeddly/skeddly-api/tree/6d02f9b6e3bedba66e16a6fb9e2503d33556f127/types/error-codes.md) related to the error.

Type: `string`

### message

Descriptive message explaining (as best as possible) the error.

Type: `string`

### modelState

Map of model errors.

Type: `object`

## Sample JSON for Unauthorized Operation

```javascript
{
    "errorCode": "UnauthorizedOperation",
    "message": "You are not authorized to execute actions:ListActions"
}
```

## Sample JSON for Invalid Parameter

```javascript
{
    "errorCode": "ParameterValidationFailed",
    "message": "Parameter validation failed",
    "modelState": {
        "parameters.InstanceIdentificationMethod": {
            "errors": [
                {
                    "errorMessage": "Invalid value for InstanceIdentificationMethod. Valid values are 'by-instance-id' or 'by-instance-name-tag'."
                }
            ]
        }
    }
}
```
