Files
ewelink-api/src/data/errors.js
Martin M 5a07f6b615 Release v3.1.1 (#112)
* fix JSON parse error when device is offline (#111)

* add 503 error and fix makeRequest mixin when device is Offline or Service is unavailable

* add 503 error and fix makeRequest mixin when device is Offline or Service is unavailable

* version bump

Co-authored-by: Luigui Delyer <git@s1x.com.br>
2020-10-18 19:17:16 -03:00

24 lines
805 B
JavaScript

const errors = {
400: 'Parameter error',
401: 'Wrong account or password',
402: 'Email inactivated',
403: 'Forbidden',
404: 'Device does not exist',
406: 'Authentication failed',
503: 'Service Temporarily Unavailable or Device is offline'
};
const customErrors = {
ch404: 'Device channel does not exist',
unknown: 'An unknown error occurred',
noDevices: 'No devices found',
noPower: 'No power usage data found',
noSensor: "Can't read sensor data from device",
noFirmware: "Can't get model or firmware version",
invalidAuth: 'Library needs to be initialized using email and password',
invalidCredentials: 'Invalid credentials provided',
invalidPowerState: 'Invalid power state. Expecting: "on", "off" or "toggle"',
};
module.exports = Object.assign(errors, customErrors);