Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[DoctrineBridge] [PropertyInfo] Catch Doctrine\ORM\Mapping\MappingException#17152
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Tobion commentedDec 28, 2015
Doctrine is missing to document the possible exception:https://github.com/doctrine/common/blob/master/lib/Doctrine/Common/Persistence/Mapping/ClassMetadataFactory.php#L47 As it does not specify which exception can be thrown, it would make more sense the catch all exceptions ( |
nicolas-grekas commentedDec 28, 2015
Catching all exceptions to ignore them could start a debugging nightmare... |
stof commentedDec 28, 2015
The ORM MappingException case here can happen when using older versions of the ORM (in newer versions, the ORM exceptions extends from the Common one and so is catched already). @Tobion an invalid mapping always throws a MappingException. Other exceptions could be thrown because of bugs, but these one should be kept uncaught here. |
Tobion commentedDec 28, 2015
@stof I don't see that ORM MappingException extends the common one:https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Mapping/MappingException.php#L27 |
stof commentedDec 28, 2015
oh, I thought it did. This looks weird. |
nicolas-grekas commentedDec 29, 2015
👍 |
1 similar comment
xabbuh commentedDec 29, 2015
👍 |
fabpot commentedDec 29, 2015
Thank you@dunglas. |
…\MappingException (dunglas)This PR was squashed before being merged into the 2.8 branch (closes#17152).Discussion----------[DoctrineBridge] [PropertyInfo] Catch Doctrine\ORM\Mapping\MappingException| Q | A| ------------- | ---| Bug fix? | yes| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets | n/a| License | MIT| Doc PR | n/aSometimes the Doctrine ORM `ClassMetadataFactory` throws a `Doctrine\Common\Persistence\Mapping\MappingException` exception, sometime a `Doctrine\ORM\Mapping\MappingException`.This PR catch both.Port ofdunglas/php-property-info#10.Commits-------ceded10 [DoctrineBridge] [PropertyInfo] Catch Doctrine\ORM\Mapping\MappingException
Sometimes the Doctrine ORM
ClassMetadataFactorythrows aDoctrine\Common\Persistence\Mapping\MappingExceptionexception, sometime aDoctrine\ORM\Mapping\MappingException.This PR catch both.
Port ofdunglas/php-property-info#10.