Table of Contents

Error Payload

Whenever an API call fails you should expect to receive an error object explaining the error that occured. The format of this error is a problem details object that follows RFC 7807.

Example:

{
  "type": "https://httpstatuses.io/429",
  "title": "Too many requests. Please try again later",
  "status": 429,
  "detail": null,
  "instance": "https://docs.enua.no/api/error-handling.html#ratelimit",
  "errorCode": "RateLimit",
  "traceId": "00-9d7c9451c536ae75c914be9a6646bcb9-32868a9fa5bafcc2-00"
}

Error Codes

The error payload have certain extensions to facilitate automatic error handling based on the given error codes.

InputValidation

User input validation error. See errors field in response for more details.

ResourceNotFound

Requested resource was not found. See resourceType field in response for more details.

ResourceAlreadyExists

Cannot create the specified resource as it already exists.

ResourceVersionConflict

Resource cannot be updated as it was already changed by someone else.

AmpereCannotExceedGivenAmount

Ampere was attempted to be increased above the allowed threshold for a resource.

DeviceTimeout

A request to an IoT device has timed out.

ResourceAlreadySet

Cannot set property because the resource already has a value assigned to this property.

ResourceLimitExceeded

The number of a certain resource has exceeded its limit.

RateLimit

Rate limit error, too many API requests have been made in a short timeframe.