In the GData Java client library, at least in the version immediately previous to 1.0.9, a great many exceptions are returned via com.google.gdata.util.ServiceException and its subclasses.
In ServiceException, there are two immediately obvious ways to obtain a concise (as opposed to stack trace level) detail message regarding the underlying error which generated the exception: getMessage() (derived from ServiceException's parent Exception class) and getResponseBody(). The problem we're encountering - in the context of using the Java Client library to access Google Calendar - is that the messages returned by these two methods are different. It would be extremely helpful if getMessage() were to return more detailed information than it currently does, incorporating any messages currently provided by getResponseBody(). Example, when accessing a Google Calendar that is not shared and none of whose events are public, when using a visibility value of 'public' in the feed URL in the GET request and not authenticating, the following values are returned: ServiceException.getMessage(): Not Found ServiceException.getResponseBody(): [... lots of HTML markup omitted here ...] <blockquote> Cannot access the calendar you requested </blockquote> [... more markup omitted here ...] The second message above is considerably more specific and helpful. At the very least, it would be desirable to have getMessage() return a concatenation of those error responses, something akin to: Not Found: Cannot access the calendar you requested Since we've only worked with the Java client library in a Google Calendar context, I don't know whether this issue may be broadly applicable to ServiceException messages throughout the library or just to messages returned from Calendar-specific exception messages. Generically, however, a Java developer using the client library should be able to rely on the fact that ServiceException.getMessage() will provide a developer-meaningful - and if at all possible, a customer- meaningful - error message, that doesn't omit any information that is provided through getResponseBody() or otherwise. Thanks! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Data API" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-help-dataapi?hl=en -~----------~----~----~----~------~----~------~--~---
