Entity Metadata Wrappers

Each appearance entity_metadata_wrapper() MUST be wrapped with try­-catch block.

try {
  // Your code goes here.

  $node_wrapper = entity_metadata_wrapper('node', $node);
}

catch (EntityMetadataWrapperException $e) {
  watchdog('yourmodule', $e->getMessage(), NULL, WATCHDOG_ERROR);
}

Please refer to RFC2119 for meaning of words MUST, SHOULD and MAY.

All donations are forwarded to Drupal Association.

Drupal is a registered trademark of Dries Buytaert.