API Integration Manual for Daikin DKN Cloud Wi-Fi Adaptor
17
4 ERRORS
Apart from the previous specific error messages returned by certain requests, there are some
common error responses that must be handled.
The error response always has the same format. Its body is a JSON object with at least two fields,
and an optional one:
-
_id
:
(String) Error id. Used for identifying the error type.
-
msg:
(String) generic error message describing the error.
-
data
(
optional
)
:
(Object) data associated with the error.
Here are the rest of the common errors, listed by their
id
:
-
badJSON
:
Returned when the request body parameters, if expecting a JSON body, is a malformed
JSON object. Error code: 400. Example response:
{
"_id": "badJSON",
"msg": "Malformed JSON"
}
-
badParams
:
Returned when the request body parameters don’t meet the interface (wrong
parameters, wrong type, missing values). Error code: 400. Example response:
{
"_id": "badParams",
"msg": "Bad body parameters"
}
-
commandNotSupported
:
Returned when the device doesn’t support the requested command. Error
code: 400. Example response:
{
"_id": "commandNotSupported",
"msg": "Command not supported"
}
-
databaseErr
:
Returned when there has been an internal problem with the database (very unusual).
Error code: 500. Example response:
{
"_id": "databaseErr",
"msg": "Error DB query"
}
-
deviceNotConnected
:
Returned when trying to set a command to a device when this one isn’t
connected to the Cloud. Error code: 422. Example response:
{
"_id": "deviceNotConnected",
"msg": "Device currently not connected to the cloud"
}
-
deviceNotFound
:
Returned when the specified MAC doesn’t match to any existing device. Error
code: 422. Example response:
{
"_id": "deviceNotFound",