How Reliable is node_save? When using node_save, how sure can one be that it did what it was supposed to do?

At the moment after any call to node_save I have been checking that the required property did succesfully update. For example:

$node-&gt;field_some_field['und'][0] = array('tid' =&gt; $some_taxonomy);
node_save($node);

if($node-&gt;field_some_field['und'][0]['tid'] == $some_taxonomy) {
    return TRUE;
} else {
    return FALSE;
}


Is this necessary? Or is there a better way to perform the check?

Edit: As an example, say I want to update a node's taxonomy programatically - it would be useful to know if it worked or not. I think it's just bad in general for things to fail silently.
I think you have to believe that node_save() is doing its job.  But, if you don't, node_save($node) is declared as sending $node by reference, so, if anything changes $node during the node_presave() hook, it will be reflected in $node after the fact.  That notwithstanding, if you wanted to be perfectly sure, you could do something like:

$nid=$node-&gt;nid;
node_load(NULL, NULL, TRUE);
$node=node_load($nid);

if ($node-&gt;.....


which would clear any node caches in your page and then reload the node from the database before your if check.

ADDITION:

From your example, the failure logic imho should be in your generation of the taxonomy value, not in worrying about if node_save() has or hasn't done its job.  For example:

   // assuming we have $node populated

   $some_taxonomy=programmatically_created_tid($args);

   if ($some_taxonomy !== FALSE) { 
     $node-&gt;field_some_field['und'][0] = array('tid' =&gt; $some_taxonomy);
   } else {
     drupal_set_message(....
     watchdog(.....
   }


where your function looks something like this:

   function programmatically_created_tid($args) {

     // do whatever logic is necessary to generate the tid

     if ($success) { // success 
       return $tid;
     } else {
       return FALSE;
     }
   }


would alert the user to the problem you are actually concerned about.