You are here

protected function EdgeEntityStorageBase::withController in Apigee Edge 8

Wraps communication with Apigee Edge.

This function converts exceptions from Apigee Edge into EntityStorageException and logs the original exceptions.

Parameters

callable $action: Communication to perform.

Throws

\Drupal\Core\Entity\EntityStorageException The converted exception.

3 calls to EdgeEntityStorageBase::withController()
EdgeEntityStorageBase::doDelete in src/Entity/Storage/EdgeEntityStorageBase.php
Performs storage-specific entity deletion.
EdgeEntityStorageBase::doSave in src/Entity/Storage/EdgeEntityStorageBase.php
Performs storage-specific saving of the entity.
EdgeEntityStorageBase::getFromStorage in src/Entity/Storage/EdgeEntityStorageBase.php
Gets entities from the storage.

File

src/Entity/Storage/EdgeEntityStorageBase.php, line 215

Class

EdgeEntityStorageBase
Base entity storage class for Apigee Edge entities.

Namespace

Drupal\apigee_edge\Entity\Storage

Code

protected function withController(callable $action) {
  try {
    $action($this
      ->entityController());
  } catch (\Exception $ex) {
    throw new EntityStorageException($ex
      ->getMessage(), $ex
      ->getCode(), $ex);
  }
}