PageRenderTime 12ms CodeModel.GetById 2ms app.highlight 5ms RepoModel.GetById 2ms app.codeStats 0ms

/facebook-java-api/src/main/java/com/google/code/facebookapi/FacebookException.java

http://facebook-java-api.googlecode.com/
Java | 67 lines | 12 code | 4 blank | 51 comment | 0 complexity | c837fad1fea2085038ab6cf7f8fead53 MD5 | raw file
 1/*
 2 +---------------------------------------------------------------------------+
 3 | Facebook Development Platform Java Client                                 |
 4 +---------------------------------------------------------------------------+
 5 | Copyright (c) 2007 Facebook, Inc.                                         |
 6 | All rights reserved.                                                      |
 7 |                                                                           |
 8 | Redistribution and use in source and binary forms, with or without        |
 9 | modification, are permitted provided that the following conditions        |
10 | are met:                                                                  |
11 |                                                                           |
12 | 1. Redistributions of source code must retain the above copyright         |
13 |    notice, this list of conditions and the following disclaimer.          |
14 | 2. Redistributions in binary form must reproduce the above copyright      |
15 |    notice, this list of conditions and the following disclaimer in the    |
16 |    documentation and/or other materials provided with the distribution.   |
17 |                                                                           |
18 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR      |
19 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.   |
21 | IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,          |
22 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT  |
23 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY     |
25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT       |
26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF  |
27 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.         |
28 +---------------------------------------------------------------------------+
29 | For help with this library, contact developers-help@facebook.com          |
30 +---------------------------------------------------------------------------+
31 */
32
33package com.google.code.facebookapi;
34
35/**
36 * 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
37 * error codes are specified by a response from the Facebook API server, though there are a few exceptions.
38 */
39public class FacebookException extends Exception {
40	/**
41	 * Serialization thing.
42	 */
43	private static final long serialVersionUID = 5347943510956485237L;
44	private int _code;
45
46	/**
47	 * Constructor
48	 * 
49	 * @param code
50	 *            the error code that caused this exception (see http://wiki.developers.facebook.com/index.php/Error_codes)
51	 * @param msg
52	 *            a message describing the nature of the error
53	 */
54	public FacebookException( int code, String msg ) {
55		super( msg );
56		_code = code;
57	}
58
59	/**
60	 * See http://wiki.developers.facebook.com/index.php/Error_codes for more information
61	 * 
62	 * @return the error code that caused this Facebook exception to be thrown.
63	 */
64	public int getCode() {
65		return _code;
66	}
67}