Class: DatabaseOperationFailed
Full name: Azera\Db\Event\DatabaseOperationFailed
Dispatched when a PDO exception is caught and being processed by
Database::processPdoException().
Listeners can use this for error logging, alerting, or metrics. The exception may be re-thrown after processing; this event fires before that decision is made.
The $operation identifies which Database operation failed
(e.g. query, prepare, execute, beginTransaction, commit,
rollback). The $sql and $params are only populated
when the failing operation had a SQL statement in scope.
Public Properties
public readonlyPDOException$exception·public readonlystring$operation·public readonlystring|null$sql·public readonlyarray|null$params·public readonlyDatabase$database·
Public methods
__construct() ·
public function __construct(Azera\Db\Database $database, PDOException $exception, string $operation, string|null $sql = null, array|null $params = null): mixed
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$database |
Database | - | |
$exception |
PDOException | - | |
$operation |
string | - | |
$sql |
string|null | null |
|
$params |
array|null | null |
Return value
- Type:
mixed