Error Handling

Exceptions

<?php
try {
  node_save($node);
  $success = TRUE;
}
catch (Exception $e) {
  // Do your error handling here
  watchdog('foo', $e, array(), WATCHDOG_ERROR)
}