Skip to content
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

Improve exception message #9646

Merged
merged 1 commit into from
Apr 10, 2022
Merged

Conversation

greg0ire
Copy link
Member

@greg0ire greg0ire commented Apr 10, 2022

This was done in reaction to this discussion: #9645

In setups where you have many parameters, or do not even realise you are
using an entity, that additional piece of context can be helpful. The
parameter name is not always available where the old exception was
called though.

Copy link
Member

@derrabus derrabus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a test for the new exception message?

In setups where you have many parameters, or do not even realise you are
using an entity, that additional piece of context can be helpful. The
parameter name is not always available where the old exception was
called though.
Binding entities to query parameters only allowed for entities that have an identifier.
Class "Doctrine\Tests\ORM\Functional\Ticket\DDC2084\MyEntity2" does not have an identifier.
EXCEPTION
);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@derrabus isn't this change in this test good enough?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😓 Sorry.

@derrabus derrabus added this to the 2.12.0 milestone Apr 10, 2022
@derrabus derrabus merged commit fda79b8 into doctrine:2.12.x Apr 10, 2022
@greg0ire greg0ire deleted the improve-ex-message branch April 11, 2022 06:38
derrabus added a commit to derrabus/orm that referenced this pull request Apr 11, 2022
* 2.12.x:
  Leverage generic persistence event classes (doctrine#9633)
  Fix static analysis for Persistence 2.5 (doctrine#9648)
  Improve exception message (doctrine#9646)
  Deprecate console helper (doctrine#9641)
  Use charset/collation from column or table default when creating relations (doctrine#9636)
  Support Enum IDs and search by Enum fields (doctrine#9629)
  Fix composer install in contributing readme
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants