You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@shindig.apache.org by Justin Wyllie <ju...@hotmail.co.uk> on 2010/06/23 16:32:11 UTC
Returning NOT_IMPLEMENTED
Hi
I can return not implemented to an RPC call to the container web page by returning this:
new opensocial.ResponseItem(null, null, opensocial.ResponseItem.Error.NOT_IMPLEMENTED, null)
The callback in the gadget gets something like this: {"originalDataRequest_":null,"data_":null,"errorCode_":"notImplemented","errorMessage_":null}
I'm not sure of the equivalent for Rest calls and Javascript API calls to the 'backend'. It seems that Shindig throws a SocialSpiException (basically a PHP Exception) which returns a string e.g. 501 Not Implemented - Not Implemented.
Is this the correct way to return NOT_IMPLEMENTED ? Probably a silly question but I was expecting to see a JSON stucture, not a string.
Thanks
Justin
_________________________________________________________________
http://clk.atdmt.com/UKM/go/197222280/direct/01/
Do you have a story that started on Hotmail? Tell us now
Re: Returning NOT_IMPLEMENTED
Posted by Paul Lindner <pl...@linkedin.com>.
Use a throw instead, here's an example:
throw new SocialSpiException("You can't update groups.",
ResponseError::$NOT_IMPLEMENTED);
On Wed, Jun 23, 2010 at 7:32 AM, Justin Wyllie
<ju...@hotmail.co.uk>wrote:
>
> Hi
> I can return not implemented to an RPC call to the container web page by
> returning this:
> new opensocial.ResponseItem(null, null,
> opensocial.ResponseItem.Error.NOT_IMPLEMENTED, null)
> The callback in the gadget gets something like this:
> {"originalDataRequest_":null,"data_":null,"errorCode_":"notImplemented","errorMessage_":null}
> I'm not sure of the equivalent for Rest calls and Javascript API calls to
> the 'backend'. It seems that Shindig throws a SocialSpiException (basically
> a PHP Exception) which returns a string e.g. 501 Not Implemented - Not
> Implemented.
> Is this the correct way to return NOT_IMPLEMENTED ? Probably a silly
> question but I was expecting to see a JSON stucture, not a string.
> Thanks
> Justin
>
>
>
>
> _________________________________________________________________
> http://clk.atdmt.com/UKM/go/197222280/direct/01/
> Do you have a story that started on Hotmail? Tell us now
>