FileDocCategorySizeDatePackage
FacebookException.javaAPI DocGoogle Facebook API v1.43498Tue Oct 23 20:32:14 BST 2007com.facebook.api

FacebookException.java

 /*
  +---------------------------------------------------------------------------+
  | Facebook Development Platform Java Client                                 |
  +---------------------------------------------------------------------------+
  | Copyright (c) 2007 Facebook, Inc.                                         |
  | All rights reserved.                                                      |
  |                                                                           |
  | Redistribution and use in source and binary forms, with or without        |
  | modification, are permitted provided that the following conditions        |
  | are met:                                                                  |
  |                                                                           |
  | 1. Redistributions of source code must retain the above copyright         |
  |    notice, this list of conditions and the following disclaimer.          |
  | 2. Redistributions in binary form must reproduce the above copyright      |
  |    notice, this list of conditions and the following disclaimer in the    |
  |    documentation and/or other materials provided with the distribution.   |
  |                                                                           |
  | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR      |
  | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
  | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.   |
  | IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,          |
  | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT  |
  | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
  | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY     |
  | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT       |
  | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF  |
  | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.         |
  +---------------------------------------------------------------------------+
  | For help with this library, contact developers-help@facebook.com          |
  +---------------------------------------------------------------------------+
 */

package com.facebook.api;

/**
 * A FacebookException is thrown by the FacebookRestClient to indicate that it encountered 
 * an error when trying to process an API request to Facebook.  In most cases, the error 
 * codes are specified by a response from the Facebook API server, though there are a 
 * few exceptions.
 */
public class FacebookException
    extends Exception {
    /**
     * Serialization thing.
     */
    private static final long serialVersionUID = 5347943510956485237L;
    private int _code;

    /**
     * Constructor
     * 
     * @param code the error code that caused this exception (see http://wiki.developers.facebook.com/index.php/Error_codes)
     * @param msg a message describing the nature of the error
     */
    public FacebookException(int code, String msg) {
        super(msg);
        _code = code;
    }

    /**
     * See http://wiki.developers.facebook.com/index.php/Error_codes for more information
     * 
     * @return the error code that caused this Facebook exception to be thrown.
     */
    public int getCode() {
        return _code;
    }
}