I'm not sure if the current exception behaviour is intended or not.

In services_client_make_node_call() we make a couple of requests to the remote endpoint to check various things:

    // Get remote UID
    $account = user_load($node->uid);
    $uid = services_client_scalar_result($client->get('uuid', 'user', array('uuid' => $account->uuid)));
    // Find out if there is already an object on the master server with this UUID
    $nid = services_client_scalar_result($client->get('uuid', 'node', array('uuid' => $node->uuid)));

The issue that I am faced with is if either of these return a 404 (because a user/node hasn't been created on the endpoint for eg.) an exception is thrown and halts execution.

Am I missing something major here?

To get around this I've placed some rather nasty nested try catch blocks around those calls and execution continues.

Thoughts?

Comments

jpstrikesback’s picture

In the catch block we return FALSE; which unnecessary halts execution right?

mhrabovcin’s picture

What services uuid module are you using? Is it one from services_client package? We made one in services_client package to return HTTP 200 with empty result rather than 404 error.

jpstrikesback’s picture

Ooh indeed, I'm using the uuid services module that comes with UUID (and I've refactored services clients ->get request to suit), that makes sense I guess as if a 401 comes up it is indeed a good reason to halt and sort things out.

mhrabovcin’s picture

Title: Intended Exception Behaviour? » services_uuid returning 404 and preventing node/user updates
Status: Active » Closed (works as designed)

Correct, 401 is error on which SC can't continue. Marking as closed