ExceptionConverterDriver.php 862 Bytes
Newer Older
1 2
<?php

Michael Moravec's avatar
Michael Moravec committed
3 4
declare(strict_types=1);

5 6 7
namespace Doctrine\DBAL\Driver;

/**
8
 * Contract for a driver that is capable of converting DBAL driver exceptions into standardized DBAL driver exceptions.
9 10 11 12
 */
interface ExceptionConverterDriver
{
    /**
13
     * Converts a given DBAL driver exception into a standardized DBAL driver exception.
14
     *
15 16
     * It evaluates the vendor specific error code and SQLSTATE and transforms
     * it into a unified {@link Doctrine\DBAL\Exception\DriverException} subclass.
17
     *
18 19
     * @param string          $message   The DBAL exception message to use.
     * @param DriverException $exception The DBAL driver exception to convert.
20
     *
21
     * @return \Doctrine\DBAL\Exception\DriverException An instance of one of the DriverException subclasses.
22
     */
23
    public function convertException($message, DriverException $exception);
24
}