How to check if a new node is correctly created using Entity Metadata Wrapper $wrapper->save()? I'm programmatically creating a new node using Entity Metadata Wrapper.

How to check if last instruction:

$ewrapper-&gt;save();


creates correctly the new node without errors?
Check that the entity has an identifier:

if ($ewrapper-&gt;getIdentifier()) {
  // Save happened.
}


A better approach might be handling any errors:

try {
  $ewrapper-&gt;save();

  // Try to do something with $ewrapper-&gt;getIdentifier()
}
catch (\Exception $e) {
  // Recover...
}