protected SqlContentEntityStorage::wrapSchemaException(callable $callback)
Wraps a database schema exception into an entity storage exception.
callable $callback: The callback to be executed.
\Drupal\Core\Entity\EntityStorageException When a database schema exception is thrown.
protected function wrapSchemaException(callable $callback) { $message = 'Exception thrown while performing a schema update.'; try { $callback(); } catch (SchemaException $e) { $message .= ' ' . $e->getMessage(); throw new EntityStorageException($message, 0, $e); } catch (DatabaseExceptionWrapper $e) { $message .= ' ' . $e->getMessage(); throw new EntityStorageException($message, 0, $e); } }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Entity!Sql!SqlContentEntityStorage.php/function/SqlContentEntityStorage::wrapSchemaException/8.1.x