Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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

Closed
dunglas wants to merge2 commits intosymfony:2.8fromdunglas:orm_mapping

Conversation

@dunglas
Copy link
Member

QA
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed ticketsn/a
LicenseMIT
Doc PRn/a

Sometimes the Doctrine ORMClassMetadataFactory throws aDoctrine\Common\Persistence\Mapping\MappingException exception, sometime aDoctrine\ORM\Mapping\MappingException.
This PR catch both.

Port ofdunglas/php-property-info#10.

@Tobion
Copy link
Contributor

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 (\Exception).

@nicolas-grekas
Copy link
Member

Catching all exceptions to ignore them could start a debugging nightmare...

@stof
Copy link
Member

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
Copy link
Contributor

@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
Copy link
Member

oh, I thought it did. This looks weird.

@nicolas-grekas
Copy link
Member

👍

1 similar comment
@xabbuh
Copy link
Member

👍

@fabpot
Copy link
Member

Thank you@dunglas.

@fabpotfabpot closed thisDec 29, 2015
fabpot added a commit that referenced this pull requestDec 29, 2015
…\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
@fabpotfabpot mentioned this pull requestJan 14, 2016
@fabpotfabpot mentioned this pull requestFeb 3, 2016
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

7 participants

@dunglas@Tobion@nicolas-grekas@stof@xabbuh@fabpot@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp