• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Al Hobbs
  • Piet Souris
  • Himai Minh

Best way to handle JSON or XML Facebook Error Response Codes using Server Side Java?

Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello there,

Don't know if this particular forum is the best place to ask this question...

What is the best way to handle error response codes generated from Facebook REST API calls using server side Java?

For example, if in a deployed app, a person calls Friends.get <http://wiki.developers.facebook.com/index.php/Friends.get >.

The following error response codes could be generated (in JSON or XML):

1 An unknown error occurred. Please resubmit the request.
2 The service is not available at this time.
4 The application has reached the maximum number of requests allowed. More requests are allowed once the time window has completed.
5 The request came from a remote address not allowed by this application.
101 The API key submitted is not associated with any known application.
102 The session key was improperly submitted or has reached its timeout. Direct the user to log in again to obtain another key.
103 The submitted call_id was not greater than the previous call_id for this session.
104 Incorrect signature.

Figured that I would write my own custom exceptions which are bubbled < http://today.java.net/pub/a/today/2006/04/06/exception-handling-antipatterns.html >,
but my project lead says that throwing custom exceptions isn't the way to go!?!

Would appreciate it if someone could suggest an alternative approach to handle the Facebook REST API error codes...

Thank you for taking the time to read this.

Happy programming.
Popeye has his spinach. I have this tiny ad:
the value of filler advertising in 2021
    Bookmark Topic Watch Topic
  • New Topic