I am using Jersey client to interact with the Facebook Graph API. The Jersey client helps me parse JSON responses into Java classes.
Sometimes Facebook sends a 400 response along with useful information about the reason for the 400 response. For example: {"error":{"message":"Error validating application. Cannot get application info due to a system error.","type":"OAuthException","code":101}}
Jersey simply throws an exception and eats up the useful part of the response :-(
How do I get it to parse the JSON into a Java class with fields corresponding to the useful error information?