-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[Bridge/Doctrine] Use better exception in the register mapping pass #18654
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
Merged
fabpot
merged 1 commit into
symfony:master
from
dantleech:better_exceptoin_mapping_pass
May 13, 2016
Merged
[Bridge/Doctrine] Use better exception in the register mapping pass #18654
fabpot
merged 1 commit into
symfony:master
from
dantleech:better_exceptoin_mapping_pass
May 13, 2016
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
e1591da to
07c46b0
Compare
07c46b0 to
a513f47
Compare
- When no manager name parameter found, throw a more informative exception.
a513f47 to
0eeedee
Compare
| } | ||
|
|
||
| throw new ParameterNotFoundException('Could not determine the Doctrine manager. Either Doctrine is not configured or a bundle is misconfigured.'); | ||
| throw new \InvalidArgumentException(sprintf( |
Contributor
Author
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 potentially a BC break if anybody was depending on the
ParameterNotFoundExceptionfor any reason. - Should this be a
DependencyInjection\Exception\InvalidArgumentExceptionor similar?
Member
|
@dantleech we prefer doing this kind of changes on master because of the potential BC break you spotted... |
Contributor
Author
|
Looks like I already based it on master by accident. |
Member
|
Thank you @dantleech. |
fabpot
added a commit
that referenced
this pull request
May 13, 2016
… mapping pass (dantleech) This PR was merged into the 3.1-dev branch. Discussion ---------- [Bridge/Doctrine] Use better exception in the register mapping pass | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | BC breaks? | no/yes ? | Deprecations? | no | Tests pass? | ? | Fixed tickets | | License | MIT | Doc PR | Current when this mapping pass cannot find (any of) the configured managers the user receives the following exception: ``` [Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException] You have requested a non-existent parameter "Could not determine the Doctrine manager. Either Doctrine is not configured or a bundle is misconfigured.". ``` Which is misleading and strange. This PR changes the exception to an `InvalidArgumentException` and provides the following message: ``` [InvalidArgumentException] Could not find the object manager name parameter. Tried: "cmf_routing.dynamic.persistence.orm.manager_name", "doctrine.default_entity_manager" ``` Commits ------- 0eeedee Use better exception in the register mapping pass
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
DoctrineBridge
DX
DX = Developer eXperience (anything that improves the experience of using Symfony)
Status: Needs Review
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Current when this mapping pass cannot find (any of) the configured managers the user receives the following exception:
Which is misleading and strange.
This PR changes the exception to an
InvalidArgumentExceptionand provides the following message: