-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Split the ORMException class #8692
Conversation
43dfbad
to
283d0bc
Compare
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.
Should the old ORMException be tagged as @internal
or @deprecated
(not sure which one is better) so that static analysis tools report its usage in catch clauses ? Otherwise, it will have to stay forever.
Also, existing factory methods in ORMException should be deprecated
namespace Doctrine\ORM\Exception; | ||
|
||
/** | ||
* This interface should be implemented by all exceptions in the Repository |
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.
this is not an interface.
And if you intend to turn it into an interface in 3.0, I suggets making it an abstract class so that users cannot instantiate it.
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.
btw, this could be introduced as an interface directly, with the actual extensions extending from the old class (for BC) and implementing the new extension.
I'd say let's mark it as |
283d0bc
to
9fa0e84
Compare
9fa0e84
to
abcb857
Compare
dc3db86
to
4efcd2e
Compare
4efcd2e
to
0684448
Compare
Rebased as I don't understand why there were 14 commits… |
Hi, prob not the best place to ask this, but I'm wondering why the old exception was deprecated when the entity manager still has it in its annotation? For example Now I have two options (or both at the same time)
Either way I don't even know which exception is thrown, so I'm not very confident in all my try/catches around Doctrine. Is this covered by a document that I would have missed? I checked the upgrade document at the root of this repo but didn't find the info I was looking for. I'm currently using 2.11.2. |
@BenoitDuffez indeed not the best place.
As you can see, this was a big PR I made ages ago, and I've probably made some mistakes. Please send a PR replacing that annotation with what seems correct from exploring all the possibilities, a quick look shows that there aren't that many. |
This is a "backport" of #6743
I'm using quotes here because it's different in that it should be backwards-compatible, and a subsequent backport of #6473 should happen on 3.0.x if this gets merged.
Todo
throw ORMException
occurrences