// BEGIN FLOCK GPL
//
// Copyright Flock Inc. 2005-2009
// http://flock.com
//
// This file may be used under the terms of the
// GNU General Public License Version 2 or later (the "GPL"),
// http://www.gnu.org/licenses/gpl.html
//
// Software distributed under the License is distributed on an "AS IS" basis,
// WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
// for the specific language governing rights and limitations under the
// License.
//
// END FLOCK GPL

#include "nsISupports.idl"


[scriptable, uuid(ed73b363-d491-4842-9594-a7b347c155b4)]
interface flockIError : nsISupports {
  /**
   * Unified Flock error code, ie. one of the const error codes defined in this
   * interface.
   * @see errorString
   */
  attribute long errorCode;

  /**
   * Description of the unified Flock error code.  This is a localized string,
   * for display to the user.
   * @see errorCode
   */
  readonly attribute AString errorString;

  /**
   * Error code used by the particular web service, if the service provides one.
   * @see serviceErrorString
   * @see serviceName
   */
  attribute AString serviceErrorCode;

  /**
   * Description of the service-specific error code, if the service provides
   * one.  May be null otherwise.
   * @see serviceErrorCode
   */
  attribute AString serviceErrorString;

  /**
   * (Optional) Used to insert the service name (eg: Facebook) into the error
   * message.
   */
  attribute AString serviceName;

  // Network errors

  // HTTP errors
  const long HTTP_CONNECTION_LOST = 0;
  const long HTTP_BAD_REQUEST = 400;
  const long HTTP_UNAUTHORIZED = 401;
  const long HTTP_NOTFOUND = 404;
  const long HTTP_INTERNAL_SERVER_ERROR = 500;
  const long HTTP_SERVER_UNAVAILABLE = 503;
  const long HTTP_GATEWAY_TIMEOUT = 504;

  // Photo errors 1001-1999
  const long PHOTOSERVICE_UNAVAILABLE = 1001;
  const long PHOTOSERVICE_LOGIN_FAILED = 1002;
  const long PHOTOSERVICE_INSUFFICIENT_PERMISSIONS = 1003;
  const long PHOTOSERVICE_INVALID_USER = 1004;
  const long PHOTOSERVICE_INVALID_SEARCH_QUERY = 1005;
  const long PHOTOSERVICE_INVALID_SEARCH_TERMS = 1006;
  const long PHOTOSERVICE_INVALID_UPLOAD_FILE = 1007;
  const long PHOTOSERVICE_UPLOAD_ERROR = 1008;
  const long PHOTOSERVICE_INVALID_ALBUM = 1009;
  const long PHOTOSERVICE_PRIVATE_ALBUM = 1010;
  const long PHOTOSERVICE_INVALID_RESPONSE = 1011;
  const long PHOTOSERVICE_USER_NOT_LOGGED_IN = 1012;
  const long PHOTOSERVICE_PHOTOS_IN_ALBUM_LIMIT_REACHED = 1013;
  const long PHOTOSERVICE_ALBUM_IS_OVER_SIZE_LIMIT = 1014;
  const long PHOTOSERVICE_NO_FILE_UPLOADED = 1015;
  const long PHOTOSERVICE_DUPLICATE_FILENAME = 1016;
  const long PHOTOSERVICE_BANDWIDTH_REACHED = 1017;
  const long PHOTOSERVICE_UNSUPPORTED_IMAGE_FORMAT = 1018;
  const long PHOTOSERVICE_INVALID_ALBUMNAME = 1019;
  const long PHOTOSERVICE_DUPLICATE_ALBUMNAME = 1020;
  const long PHOTOSERVICE_SESSION_KEY_EXPIRED = 1021;
  const long PHOTOSERVICE_FILE_IS_OVER_SIZE_LIMIT = 1023;
  const long PHOTOSERVICE_FILE_EMPTY = 1024;
  const long PHOTOSERVICE_INVALID_API_KEY = 1025;
  const long PHOTOSERVICE_INVALID_QUERY = 1026;
  const long PHOTOSERVICE_EMPTY_ALBUMNAME = 1027;
  const long PHOTOSERVICE_REQUEST_LIMIT_REACHED = 1028;
  const long PHOTOSERVICE_FRIENDS_ONLY = 1029;
  const long PHOTOSERVICE_UNKNOWN_ERROR = 1999;

  // Blog errors 2000-2999
  const long BLOG_UNAVAILABLE = 2001;
  const long BLOG_INVALID_AUTH = 2002;
  const long BLOG_INVALID_HTML = 2003;
  const long BLOG_CAPTCHA_REQUIRED = 2004;
  const long BLOG_NOT_VERIFIED = 2005;
  const long BLOG_NOT_ALLOWED = 2006;
  const long BLOG_LOGIN_REQUIRED = 2010;
  const long BLOG_UNKNOWN_ERROR = 2999;

  // Favorites errors 3000-3999
  const long FAVS_UNAVAILABLE = 3001;
  const long FAVS_INVALID_AUTH = 3002;
  const long FAVS_UNKNOWN_ERROR = 3999;

  // Feeds errors 4000-4999

  // OPML errors 5000-5999
  const long OPML_INVALID_XML = 5001;
  const long OPML_NO_DATA = 5002;
  const long OPML_TOO_DEEP = 5003;
  const long OPML_NO_FEEDS = 5004;
  const long OPML_BAD_FEED_URL = 5005;

  // Webmail errors 6000-6099
  const long WEBMAIL_API_INVALID_XML = 6001;
  const long WEBMAIL_API_CANNOT_PARSE = 6002;
  const long WEBMAIL_UNKNOWN_ERROR = 6099;

  //Google errors 7000-7099
  const long GOOGLE_LOGIN_ERROR = 7001;
  const long GOOGLE_UNKNOWN_ERROR = 7099;
};
