classZtdPdoException
class ZtdPdoException
extends PDOException
Public API: explicitly declared with
@visibility public.ZTD-specific exception that extends PDOException.
This allows users to catch either PDOException or ZtdPdoException for ZTD-specific errors while maintaining compatibility with existing PDO exception handling code.
$error = new \ZtdQuery\Adapter\Pdo\ZtdPdoException('Cannot simulate this statement');
$error instanceof \PDOException // => trueMethods§
public function __construct(string $message, int $code = 0, ?Throwable $previous = null)Public API: explicitly declared with
@visibility public.Binds the instance to what it will work from.
Parameters
$message | string | |
$code | int | |
$previous | ?Throwable |
$cause = new \RuntimeException('Database failure');
$error = new \ZtdQuery\Adapter\Pdo\ZtdPdoException('Simulation failed', 7, $cause);
$error->getMessage() // => 'Simulation failed'
$error->getCode() // => 7
$error->getPrevious() === $cause // => trueCalls 1
- static-call
PDOException::__construct()line 39
Test cases 16§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 5
Other tests reaching this symbol 11
SqliteErrorHandlingTest::testLateTableMutationRespectsExceptionBehaviorcallsSqliteErrorHandlingTest::testUnsupportedSqlWithExceptionBehaviorcallsPdoConnectionTestcallsPdoStatementTestcallsConnectionExecutionTestcallsDriverSessionFactoryTestcallsParameterBinderTestcallsPreparedQueryTest::testPrepareReportsASilentDriverFailurecallsStatementExecutionTestcallsZtdPdoStatementTestcallsZtdPdoTestcalls
Relations§
Instantiated in 4
- new ZtdQuery\Adapter\Pdo\Session\ConnectionExecution::prepare() packages/ztd-query-pdo-adapter/src/Session/ConnectionExecution.php:73
- new ZtdQuery\Adapter\Pdo\Session\ConnectionExecution::exec() packages/ztd-query-pdo-adapter/src/Session/ConnectionExecution.php:163
- new ZtdQuery\Adapter\Pdo\Session\PreparedQuery::prepare() packages/ztd-query-pdo-adapter/src/Session/PreparedQuery.php:51
- new ZtdQuery\Adapter\Pdo\Session\StatementExecution::postProcess() packages/ztd-query-pdo-adapter/src/Session/StatementExecution.php:93