class ExceptionHandler
Same name in this branch
- 11.x core/modules/mysql/src/Driver/Database/mysql/ExceptionHandler.php \Drupal\mysql\Driver\Database\mysql\ExceptionHandler
- 11.x core/tests/fixtures/database_drivers/module/core_fake/src/Driver/Database/CoreFakeWithAllCustomClasses/ExceptionHandler.php \Drupal\core_fake\Driver\Database\CoreFakeWithAllCustomClasses\ExceptionHandler
- 11.x core/lib/Drupal/Core/Database/ExceptionHandler.php \Drupal\Core\Database\ExceptionHandler
Same name and namespace in other branches
- 9 core/modules/mysql/src/Driver/Database/mysql/ExceptionHandler.php \Drupal\mysql\Driver\Database\mysql\ExceptionHandler
- 9 core/tests/fixtures/database_drivers/module/corefake/src/Driver/Database/corefakeWithAllCustomClasses/ExceptionHandler.php \Drupal\corefake\Driver\Database\corefakeWithAllCustomClasses\ExceptionHandler
- 9 core/lib/Drupal/Core/Database/Driver/mysql/ExceptionHandler.php \Drupal\Core\Database\Driver\mysql\ExceptionHandler
- 9 core/lib/Drupal/Core/Database/ExceptionHandler.php \Drupal\Core\Database\ExceptionHandler
- 10 core/modules/mysql/src/Driver/Database/mysql/ExceptionHandler.php \Drupal\mysql\Driver\Database\mysql\ExceptionHandler
- 10 core/tests/fixtures/database_drivers/module/core_fake/src/Driver/Database/CoreFakeWithAllCustomClasses/ExceptionHandler.php \Drupal\core_fake\Driver\Database\CoreFakeWithAllCustomClasses\ExceptionHandler
- 10 core/lib/Drupal/Core/Database/Driver/mysql/ExceptionHandler.php \Drupal\Core\Database\Driver\mysql\ExceptionHandler
- 10 core/lib/Drupal/Core/Database/ExceptionHandler.php \Drupal\Core\Database\ExceptionHandler
MySQLi database exception handler class.
Hierarchy
- class \Drupal\Core\Database\ExceptionHandler
- class \Drupal\mysql\Driver\Database\mysql\ExceptionHandler implements \Drupal\Core\Database\ExceptionHandler
- class \Drupal\mysqli\Driver\Database\mysqli\ExceptionHandler implements \Drupal\mysql\Driver\Database\mysql\ExceptionHandler
- class \Drupal\mysql\Driver\Database\mysql\ExceptionHandler implements \Drupal\Core\Database\ExceptionHandler
Expanded class hierarchy of ExceptionHandler
1 string reference to 'ExceptionHandler'
- ConnectionTest::providerGetDriverClass in core/
tests/ Drupal/ Tests/ Core/ Database/ ConnectionTest.php - Data provider for testGetDriverClass().
File
-
core/
modules/ mysqli/ src/ Driver/ Database/ mysqli/ ExceptionHandler.php, line 13
Namespace
Drupal\mysqli\Driver\Database\mysqliView source
class ExceptionHandler extends BaseMySqlExceptionHandler {
/**
* {@inheritdoc}
*/
public function handleExecutionException(\Exception $exception, StatementInterface $statement, array $arguments = [], array $options = []) : void {
// Close the client statement to release handles.
if ($statement->hasClientStatement()) {
$statement->getClientStatement()
->close();
}
if (!$exception instanceof \mysqli_sql_exception) {
throw $exception;
}
$this->rethrowNormalizedException($exception, $exception->getSqlState(), $exception->getCode(), $statement->getQueryString(), $arguments);
}
}
Members
Title Sort descending | Modifiers | Object type | Summary | Overriden Title |
---|---|---|---|---|
ExceptionHandler::handleExecutionException | public | function | Handles exceptions thrown during execution of statement objects. | Overrides ExceptionHandler::handleExecutionException |
ExceptionHandler::handleStatementException | public | function | Handles exceptions thrown during the preparation of statement objects. | |
ExceptionHandler::rethrowNormalizedException | protected | function | Rethrows exceptions thrown during execution of statement objects. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.