DriverException.php 921 Bytes
Newer Older
1 2
<?php

3
namespace Doctrine\DBAL\Driver;
4

5 6
use Throwable;

7
/**
8 9 10 11
 * Contract for a driver exception.
 *
 * Driver exceptions provide the SQLSTATE of the driver
 * and the driver specific error code at the time the error occurred.
12
 */
13
interface DriverException extends Throwable
14
{
15 16 17 18 19 20
    /**
     * Returns the driver specific error code if available.
     *
     * Returns null if no driver specific error code is available
     * for the error raised by the driver.
     *
21
     * @return int|string|null
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
     */
    public function getErrorCode();

    /**
     * Returns the driver error message.
     *
     * @return string
     */
    public function getMessage();

    /**
     * Returns the SQLSTATE the driver was in at the time the error occurred.
     *
     * Returns null if the driver does not provide a SQLSTATE for the error occurred.
     *
     * @return string|null
     */
    public function getSQLState();
40
}