On Tue, Jan 13, 2009 at 2:19 PM, Henning Schmiedehausen <
[email protected]> wrote:

> While debugging some problems with a backend site, I noticed that the
> current code in MakeRequestHandler (convertResponseToJson) doesn't
> really care at all about the return code of the HttpResponse. In my
> case, the other side was returning a 503 (and an XTHMLish document)
> which was happily parsed into a JSON object until it hit some snag and
> ended up with a FeedException.
>
> I was wondering on how to deal with this, mainly because the
> corresponding javascript code in core.io/io.js also has no concept of
> the other side failing (even the spec at
>
> http://www.opensocial.org/Technical-Resources/opensocial-spec-v08/gadgets-reference08#gadgets.io.makeRequest
> is pretty much ignoring the fact that the other side could fail. What
> would be the preferred response. Do as if nothing happened and just
> return an empty json object?)


Unless there was a bug introduces recently, what should happen here is that
we return a json blob that looks like this:

{rc: 503, errors:[array of errors]}

And developers check the value of 'rc'.

It's another area where the spec doesn't actually say anything though.


>
>
>    Ciao
>         Henning
>

Reply via email to