diff --git a/UPGRADE.md b/UPGRADE.md index 09e7ac5f941..34448db1a80 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -1,5 +1,9 @@ # Upgrade to 2.11 +## `DriverException::getErrorCode()` is deprecated + +The `DriverException::getErrorCode()` is deprecated as redundant and inconsistently supported by drivers. Use `::getCode()` or `::getSQLState()` instead. + ## Non-interface driver methods have been marked internal The non-interface methods of driver-level classes have been marked internal: diff --git a/lib/Doctrine/DBAL/Driver/Exception.php b/lib/Doctrine/DBAL/Driver/Exception.php index f65591f90ca..a16db4f8adc 100644 --- a/lib/Doctrine/DBAL/Driver/Exception.php +++ b/lib/Doctrine/DBAL/Driver/Exception.php @@ -14,6 +14,8 @@ interface Exception extends Throwable /** * Returns the driver specific error code if available. * + * @deprecated Use {@link getCode()} or {@link getSQLState()} instead + * * Returns null if no driver specific error code is available * for the error raised by the driver. *