-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
[WIP][Form] Improve transformation failure message by providing property path #11318
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
[WIP][Form] Improve transformation failure message by providing property path #11318
Conversation
jubianchi
commented
Jul 5, 2014
Q | A |
---|---|
Bug fix? | no |
New feature? | yes |
BC breaks? | no |
Deprecations? | no |
Tests pass? | |
Fixed tickets | #11287 |
License | MIT |
Doc PR |
@@ -37,7 +37,7 @@ public function reverseTransform($value) | |||
$result = array_search($value, $this->mapping, true); | |||
|
|||
if ($result === false) { | |||
throw new RuntimeException(sprintf('No reverse mapping for value "%s"', $value)); | |||
throw new TransformationFailedException(sprintf('No reverse mapping for value "%s"', $value)); |
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.
Interesting - it seems that this test class should have always thrown this (i.e. it was a minor bug in the test I think). Unless I'm missing something, nice work!
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.
I said myself the same when reading the code :)
} | ||
} catch (TransformationFailedException $exception) { | ||
throw new TransformationFailedException( | ||
'Unable to transform value for property path "' . $this->getPropertyPath() . '": ' . $exception->getMessage(), |
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 a reverse transform now, I guess we could say "reverse" here :)
👍 |
1 similar comment
👍 |
Thank you @jubianchi. |
…providing property path (jubianchi) This PR was squashed before being merged into the 2.6-dev branch (closes #11318). Discussion ---------- [WIP][Form] Improve transformation failure message by providing property path | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | | Fixed tickets | #11287 | License | MIT | Doc PR | Commits ------- d56b7be [WIP][Form] Improve transformation failure message by providing property path