Error messages refactored

This commit is contained in:
estevez-dev
2019-09-03 23:25:39 +03:00
parent 620aa3b8d8
commit 8efeb3da8a
8 changed files with 330 additions and 68 deletions

View File

@ -96,4 +96,28 @@ class CardType {
static const conditional = "conditional";
static const alarmPanel = "alarm-panel";
static const markdown = "markdown";
}
class UserError {
final int code;
final String message;
UserError({@required this.code, this.message: ""});
}
class ErrorCode {
static const UNKNOWN = 0;
static const NOT_CONFIGURED = 1;
static const AUTH_INVALID = 2;
static const NO_MOBILE_APP_COMPONENT = 3;
static const ERROR_GETTING_CONFIG = 4;
static const ERROR_GETTING_STATES = 5;
static const ERROR_GETTING_LOVELACE_CONFIG = 6;
static const ERROR_GETTING_PANELS = 7;
static const CONNECTION_TIMEOUT = 8;
static const DISCONNECTED = 9;
static const UNABLE_TO_CONNECT = 10;
static const GENERAL_AUTH_ERROR = 11;
static const AUTH_ERROR = 12;
static const NOT_LOGGED_IN = 13;
}