/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. package com.google.code.facebookapi;
  33. /**
  34. * 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
  35. * error codes are specified by a response from the Facebook API server, though there are a few exceptions.
  36. */
  37. public class FacebookException extends Exception {
  38. /**
  39. * Serialization thing.
  40. */
  41. private static final long serialVersionUID = 5347943510956485237L;
  42. private int _code;
  43. /**
  44. * Constructor
  45. *
  46. * @param code
  47. * the error code that caused this exception (see http://wiki.developers.facebook.com/index.php/Error_codes)
  48. * @param msg
  49. * a message describing the nature of the error
  50. */
  51. public FacebookException( int code, String msg ) {
  52. super( msg );
  53. _code = code;
  54. }
  55. /**
  56. * See http://wiki.developers.facebook.com/index.php/Error_codes for more information
  57. *
  58. * @return the error code that caused this Facebook exception to be thrown.
  59. */
  60. public int getCode() {
  61. return _code;
  62. }
  63. }