ExceptionConverterDriver.php 836 Bytes
Newer Older
1 2 3 4 5
<?php

namespace Doctrine\DBAL\Driver;

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