-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Revert Exception Class renames #4272
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I said, I'm strongly against this change. Especially the insane name at the driver level that 99% of the users don't deal with.
8510571
to
64ebece
Compare
I am not going to approve this change. The DBAL prefix doesn't add any value because the exception is already part of the DBAL package. It might make sense to have a It's one of the smallest deprecations among 34 total deprecations that 2.11.x introduces. As I said earlier, DBAL exceptions are either logical exceptions that are not supposed to be handled or the runtime ones that are usually handled at the presentation layer. So the impact of this change on real projects should be negligible. I do not share the opinion that the DBAL prefix of the class name should solve the problem of the non-fully-qualified
I wouldn't call the 704 occurrences in ~3700 projects widespread. It's ~1 occurrence per 5 projects which proves the point. |
@morozov The only argument that counts is that its a convention across all Doctrine projects that a base exception exists that has the name of the component. We haven't changed this convention even though the coding standard was defined in defiance of it. In addition to that argument, the deprecation seems the smallest, but is actually very nasty, because a Most of the other deprecations are either in the factory related code, or directly in execution and fetching. Honestly I don't think we should deprecate those either, we could keep them and just not document them, but it will be much more obvious to users to see once we trigger the deprecations. |
How can one oversee that? $ git grep DBALException
Any exception can happen in a transaction: Lines 1140 to 1144 in 789d900
Catching only a specific type looks like a bad idea in the first place. |
82937c7
to
a2f834a
Compare
a2f834a
to
f5e8bcf
Compare
I see that this is a pain point so here is my opinion in case it helps: the DBAL has only ever had one major version since its inception if I believe packagist, so I think people will know that the upgrade is not to be taken lightly, and read the upgrade guide. Changing the name of the exception is OK in my opinion, but I do agree that this could be dangerous? Maybe we could focus on making sure they don't miss that one part of the migration since it's more likely to slip through, |
What do you think about tools like rector/rector to ease a migration of the exception changes? Adding a new tool or at least the config file of the tool isn't a trivial decision, but maybe a help for developers. |
It looks like there is already something BTW: https://github.com/rectorphp/rector/blob/master/config/set/doctrine-dbal-30.php |
@morozov as per our discussion we decided to roll this back for now. How do we proceed? Can you approve the PR? |
I don't remember making this decision. I don't approve of this change. |
Summary
This reverts the rename of
DBALException
. This is based on discussions in Slack and doctrine/coding-standard#219 that keeps the Doctrine convention of having the component level exception prefixed by the component name, not using Exceptions without a prefix to avoid confusion with the globalException
or other namespaces usingException
.Foremost, the
DBALException
rename is reverted, because its use is widespread in open source and private projects and Exception renames are an easy source for nasty bugs.