-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Validator] Made it possible to store the cause of a constraint violation #12052
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
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
This was referenced Sep 26, 2014
@@ -14,6 +14,8 @@ CHANGELOG | |||
* deprecated `ClassMetadata::addMemberMetadata()` | |||
* [BC BREAK] added `Mapping\MetadataInterface::getConstraints()` | |||
* added generic "payload" option to all constraints for attaching domain-specific data | |||
* [BC BREAK] added `ConstraintViolationBuilderInterface::setCause()` | |||
* [ |
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.
weird line here ;)
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.
cyclops robot is sad *[
no?
👍 once the changelog is fixed |
0f07044
to
499eeb4
Compare
Updated. |
webmozart
added a commit
that referenced
this pull request
Sep 30, 2014
…onstraint violation (webmozart) This PR was merged into the 2.6-dev branch. Discussion ---------- [Validator] Made it possible to store the cause of a constraint violation | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes | BC breaks? | yes | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | TODO This change makes it possible to store the cause of a violation (e.g. an exception). This way it is possible to follow the trace of violations caused by exceptions up to their root. ```php try { // ... } catch (Exception $e) { $this->context->buildViolation('Error!') ->setCause($e) ->addViolation(); } ``` This is one step to solve #5607. See #12054. Commits ------- 499eeb4 [Validator] Made it possible to store the cause of a constraint violation
webmozart
added a commit
that referenced
this pull request
Sep 30, 2014
…e profiler (webmozart) This PR was merged into the 2.6-dev branch. Discussion ---------- [Form] The trace of form errors is now displayed in the profiler | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes | BC breaks? | yes | Deprecations? | no | Tests pass? | yes | Fixed tickets | #5607 | License | MIT | Doc PR | - This is a follow-up PR for #12052. With this change, the full trace of form errors is now displayed in the web debugger:  If a violation was caused by a TransformationFailedException, the exception is now accessible through the `getCause()` method of the violation. Additionally, you can access `Form::getTransformationFailure()` to retrieve the exception. Commits ------- 8dbe258 [Form] The trace of form errors is now displayed in the profiler
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This change makes it possible to store the cause of a violation (e.g. an exception). This way it is possible to follow the trace of violations caused by exceptions up to their root.
This is one step to solve #5607. See #12054.