usergrid/usergrid — pull request #104 by timwillsie (2014-04-12 19:27:01+00:00)
Title: catching "service resource not found" exception in create_entity

Hey there!
I started working with the user grid PHP SDK and had trouble passing the tests once exceptions were enabled.

This is what I think solved it for me:

create_entity tries to fetch an entity prior to creating one.
This might raise an UG_401_Unauthorized exception which is not caught though it is to be expected.
Now it is okay to save the new entity if the exception message equals 'org.apache.usergrid.services.exceptions.ServiceResourceNotFoundException' (are there any constants for that?), any other types of exceptions will be thrown on.

I'm curious what you think about it. I might still be on the wrong track here, as I said, I just started working with it...

Greets, Tim.