Exception.php 756 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
<?php

declare(strict_types=1);

namespace Doctrine\DBAL\Driver;

use Throwable;

/**
 * @psalm-immutable
 */
interface Exception extends Throwable
{
    /**
     * Returns the driver specific error code if available.
     *
17 18
     * @deprecated Use {@link getCode()} or {@link getSQLState()} instead
     *
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
     * Returns null if no driver specific error code is available
     * for the error raised by the driver.
     *
     * @return int|string|null
     */
    public function getErrorCode();

    /**
     * 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();
}