Server error :Reserved for implementation-defined server-errors. const E_PARSE_ERROR = "-32700"; const E_INVALID_REQUEST = "-32600"; const E_METHOD_NOT_FOUND = "-32601"; const E_INVALID_PARAMS = "-32602"; const E_INTERNAL_ERROR = "-32603"; // Errors inherited from Expresso Application. const LOGIN_SUCCESS_LOGOUT = "1"; const LOGIN_SESSION_EXPIRED = "2"; const LOGIN_NOT_LOGGED_IN = "3"; const LOGIN_COOKIES_REQUIRED = "4"; const LOGIN_BADLOGIN = "5"; const LOGIN_PASSWORD_EXPIRED = "6"; const LOGIN_AUTH_INVALID = "7"; const LOGIN_SESSION_NOT_VERIFIED = "10"; const LOGIN_ACCOUNT_EXPIRED = "98"; const LOGIN_LOGIN_BLOCKED = "99"; const LOGIN_INVALID_LOGIN = "200"; const CATALOG_MIN_ARGUMENT_SEARCH = "1001"; static private $reservedErrors = array ( self::E_PARSE_ERROR => "Parse error", self::E_INVALID_REQUEST => "Invalid Request", self::E_METHOD_NOT_FOUND => "Method not found", self::E_INVALID_PARAMS => "Invalid params", self::E_INTERNAL_ERROR => "Internal error" ); // Errors inherited from Expresso Application. static private $applicationErrors = array( self::LOGIN_SUCCESS_LOGOUT => "You have been successfully logged out", self::LOGIN_SESSION_EXPIRED => "Sorry, your login has expired", self::LOGIN_NOT_LOGGED_IN => "You are not logged in", self::LOGIN_COOKIES_REQUIRED => "Cookies are required to login to this site.", self::LOGIN_BADLOGIN => "bad login or password", self::LOGIN_PASSWORD_EXPIRED => "Your password has expired, and you do not have access to change it", self::LOGIN_AUTH_INVALID => "Your auth is invalid", self::LOGIN_SESSION_NOT_VERIFIED => "Your session could not be verified.", self::LOGIN_ACCOUNT_EXPIRED => "Account is expired", self::LOGIN_LOGIN_BLOCKED => "Blocked, too many attempts!", self::LOGIN_INVALID_LOGIN => "Bad login or password", self::CATALOG_MIN_ARGUMENT_SEARCH => "Your search argument must be longer than %1 characters." ); static public function get($code, $jsonrpc = "2.0"){ $errors = self::$reservedErrors + self::$applicationErrors; if($jsonrpc == "2.0") return array ("code" => $code, "message" => $errors[$code]); else return $errors[$code]; } }