You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When writing a custom driver, at some point we need to implement ExceptionConverter interface.
The convert() method requires to return a DriverException.
However this class is marked as internal and triggers a warning:
The "Doctrine\DBAL\Exception\DriverException::__construct()" method is considered internal. It may change without further notice. You should not extend it from "App\DBAL\Exception\DriverException".
Could you consider returning the Doctrine\DBAL\Driver\Exception interface instead in the future?
PS: thanks for you amazing work!
The text was updated successfully, but these errors were encountered:
The convert() method requires to return a DriverException. However this class is marked as internal and triggers a warning:
The "Doctrine\DBAL\Exception\DriverException::__construct()" method is considered internal. It may change without further notice. You should not extend it from "App\DBAL\Exception\DriverException".
We should probably not flag the constructor as @internal. I'm open to removing this annotation on 4.1.x because custom drivers need to call that constructor. Please send a PR.
That being said: this might not be the only "internal" API you will need to call for your custom driver. Please keep opening issues if you run into more of them. ✌🏻
Could you consider returning the Doctrine\DBAL\Driver\Exception interface instead in the future?
That's a terrible idea. The whole point of the exception converter is to upcast an exception specific to your database to one of the well-known exceptions that extend DriverException. If the converter returned anything else, the wrapper layer or the application wouldn't know what to do with that exception.
Feature Request
Summary
When writing a custom driver, at some point we need to implement ExceptionConverter interface.
The
convert()
method requires to return a DriverException.However this class is marked as internal and triggers a warning:
Could you consider returning the
Doctrine\DBAL\Driver\Exception
interface instead in the future?PS: thanks for you amazing work!
The text was updated successfully, but these errors were encountered: