Proposal 0.8 - Add getErrorMessage to DataResponse

0 views
Skip to first unread message

Louis Ryan

unread,
Apr 15, 2008, 1:04:27 PM4/15/08
to opensocial-an...@googlegroups.com
Hi,

There is no simple mechanism in the spec to specify an error occurred at the Datarequest/Dataresponse level rather than the more granular ResponseItem level. For example if there was a 500 err making the XMLHttprequest we have no good way to convey that information to the developer.

Proposal:
Dataresponse.hadError returns true if there was an HTTP (or other batch level) error or an error processing an element of the batch
DataResponse.getErrorMessage returns a message describing the batch-level error if it exists otherwise undefined

Im not sure theres alot of value in adding an enumeration of possible failure modes like ResponseItem.Error but I could be convinced

-Louis

Cassie

unread,
Apr 21, 2008, 5:40:32 AM4/21/08
to opensocial-an...@googlegroups.com
Did you want a dataResponse.getError as well? or just errorMessage?

Louis Ryan

unread,
Apr 21, 2008, 1:59:01 PM4/21/08
to opensocial-an...@googlegroups.com
Seeing as theres no valid enum of error types I think just getErrorMessage is sufficient.

Arne Roomann-Kurrik (Google)

unread,
Apr 24, 2008, 6:40:56 PM4/24/08
to OpenSocial and Gadgets Specification Discussion
+1

On Apr 21, 10:59 am, "Louis Ryan" <lr...@google.com> wrote:
> Seeing as theres no valid enum of error types I think just getErrorMessage
> is sufficient.
>

Lane LiaBraaten

unread,
Apr 24, 2008, 7:41:26 PM4/24/08
to opensocial-an...@googlegroups.com
+1 for getErrorMessage

Robert Evans

unread,
Apr 25, 2008, 2:39:35 AM4/25/08
to opensocial-an...@googlegroups.com
+1

Cassie

unread,
Apr 25, 2008, 7:14:38 AM4/25/08
to opensocial-an...@googlegroups.com
Okay, so Louis, Lane, Arne and Bob are for this.

Louis - just a quick mention, couldn't a getError() method just reuse the error codes currently defined on ResponseItem? Those are all http error codes... so it seems to fit. (especially internal error or forbidden)

If those don't fit, just curious, what types of error messages will you be returning?
Thanks.

- Cassie

Louis Ryan

unread,
Apr 25, 2008, 1:32:04 PM4/25/08
to opensocial-an...@googlegroups.com
Do we want to add cases for pretty common HTTP responses to ResponseItem.Error then?

temporarily unavailable,  host unreachable, ....

or just return that status information from the XHR object which would include the HTTP response code in the error message and leave it at that. I would prefer the latter.

Arne Roomann-Kurrik

unread,
Apr 25, 2008, 2:18:42 PM4/25/08
to opensocial-an...@googlegroups.com
I like the latter approach as well - might as well keep the data in a format that developers are already familiar with.

~Arne
--
OpenSocial IRC - irc://irc.freenode.net/opensocial

Robert Evans

unread,
Apr 25, 2008, 2:22:46 PM4/25/08
to opensocial-an...@googlegroups.com
Agree

Zhen Wang

unread,
Apr 25, 2008, 5:47:17 PM4/25/08
to opensocial-an...@googlegroups.com
+1

On Fri, Apr 25, 2008 at 11:18 AM, Arne Roomann-Kurrik <kur...@google.com> wrote:

mnew...@myspace.com

unread,
Apr 25, 2008, 6:38:20 PM4/25/08
to OpenSocial and Gadgets Specification Discussion
+1, xhr status being returned in the error message.

On Apr 25, 11:22 am, Robert Evans <bobev...@google.com> wrote:
> Agree
>
> On Fri, Apr 25, 2008 at 11:18 AM, Arne Roomann-Kurrik <kur...@google.com>
> wrote:
>
> > I like the latter approach as well - might as well keep the data in a
> > format that developers are already familiar with.
>
> > ~Arne
>
> > On Fri, Apr 25, 2008 at 10:32 AM, Louis Ryan <lr...@google.com> wrote:
>
> >> Do we want to add cases for pretty common HTTP responses to
> >> ResponseItem.Error then?
>
> >> temporarily unavailable, host unreachable, ....
>
> >> or just return that status information from the XHR object which would
> >> include the HTTP response code in the error message and leave it at that. I
> >> would prefer the latter.
>
> >> On Fri, Apr 25, 2008 at 4:14 AM, Cassie <d...@google.com> wrote:
>
> >>> Okay, so Louis, Lane, Arne and Bob are for this.
>
> >>> Louis - just a quick mention, couldn't a getError() method just reuse the
> >>> error codes currently defined on ResponseItem? Those are all http error
> >>> codes... so it seems to fit. (especially internal error or forbidden)
>
> >>> If those don't fit, just curious, what types of error messages will you
> >>> be returning?
> >>> Thanks.
>
> >>> - Cassie
>
> >>> On Fri, Apr 25, 2008 at 8:39 AM, Robert Evans <bobev...@google.com>
> >>> wrote:
>
> >>>> +1
>
> >>>> On Thu, Apr 24, 2008 at 4:41 PM, Lane LiaBraaten <lliab...@google.com>

Paul

unread,
Apr 25, 2008, 9:47:26 PM4/25/08
to OpenSocial and Gadgets Specification Discussion
+1

I would prefer to see the error pattern on DataResponse match that of
ResponseItem. Perhaps some error enum values that are currently
defined in the responseItem error are more appropriate at this level.
Maybe it would be cleaner for the developer to always check http level
related errors at the DataResponse level and be assured that
ResponseItem errors are only policy/permission/context errors.

~Paul

Cassie

unread,
Apr 27, 2008, 6:47:28 PM4/27/08
to opensocial-an...@googlegroups.com
Okay, this has gotten enough votes so getErrorMessage being added as a method to the dataResponse object is approved.

Paul - these are good considerations to keep in mind. We may want to further improve our error reporting in many different ways. Perhaps we should come up with a complete proposal for 0.9 and take this current change as just a first step.

Thanks!

- Cassie
Reply all
Reply to author
Forward
0 new messages