Converts a given driver-level exception into a DBAL-level driver exception.
Converts a given driver-level exception into a DBAL-level driver exception.
Implementors should use the vendor-specific error code and SQLSTATE of the exception
and instantiate the most appropriate specialized {@see DriverException} subclass.
Parameters
$exception
The driver exception to convert.
$query
The SQL query that triggered the exception, if any.
Returns
An instance of {@see DriverException} or one of its subclasses.