Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[PropertyAccess] Add Property Path to Exception Message #27586

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
merged 1 commit into from
Jun 25, 2018
Merged

[PropertyAccess] Add Property Path to Exception Message #27586

merged 1 commit into from
Jun 25, 2018

Conversation

rodnaph
Copy link
Contributor

@rodnaph rodnaph commented Jun 12, 2018

Q A
Branch? master
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets None
License MIT
Doc PR None

When an exception is thrown writing a property it is not currently obvious which path is at fault (eg. Expected argument of type "%s", "%s" given - but where?). This patch appends the current property path to the exception so it is clear which path caused the error (eg. Expected argument of type "%s", "%s" given at property path "foo.bar")

@nicolas-grekas nicolas-grekas added this to the next milestone Jun 14, 2018
@fabpot
Copy link
Member

fabpot commented Jun 25, 2018

Thank you @rodnaph.

@fabpot fabpot merged commit 473a025 into symfony:master Jun 25, 2018
fabpot added a commit that referenced this pull request Jun 25, 2018
…e (rodnaph)

This PR was merged into the 4.2-dev branch.

Discussion
----------

[PropertyAccess] Add Property Path to Exception Message

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | None
| License       | MIT
| Doc PR        | None

When an exception is thrown writing a property it is not currently obvious which path is at fault (eg. `Expected argument of type "%s", "%s" given` - but where?). This patch appends the current property path to the exception so it is clear which path caused the error (eg. `Expected argument of type "%s", "%s" given at property path "foo.bar"`)

Commits
-------

473a025 add property path to exception message when error writing property
xabbuh added a commit to opensoftwareconsulting/rich-model-forms-bundle that referenced this pull request Aug 24, 2018
This PR was merged into the 0.1-dev branch.

Discussion
----------

relax assertion on exception for forward compat

see symfony/symfony#27586

Commits
-------

13414e2 relax assertion on exception for forward compat
@nicolas-grekas nicolas-grekas modified the milestones: next, 4.2 Nov 1, 2018
This was referenced Nov 3, 2018
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.

5 participants