LG-7417 Standardize failure responses#7006
Merged
ThatSpaceGuy merged 13 commits intomainfrom Sep 24, 2022
Merged
Conversation
Rwolfe-Nava
reviewed
Sep 22, 2022
Rwolfe-Nava
approved these changes
Sep 22, 2022
Contributor
Rwolfe-Nava
left a comment
There was a problem hiding this comment.
This looks good to me. Much needed work. Thank you!
n1zyy
approved these changes
Sep 22, 2022
Contributor
n1zyy
left a comment
There was a problem hiding this comment.
This turned out great! Thanks for running with this.
spec/controllers/account_reset/delete_account_controller_spec.rb
Outdated
Show resolved
Hide resolved
Contributor
There was a problem hiding this comment.
Explaining in case anyone else finds themselves wondering, "Shouldn't Osman's PR have caused this to not show up anyway?"
No, because we're still calling the event with failure_reason, it's just getting stripped out before it's returned to the user. (By design.)
spec/controllers/account_reset/delete_account_controller_spec.rb
Outdated
Show resolved
Hide resolved
changelog: Internal, Attempts API, Standardize events
7ec9799 to
882cbf0
Compare
n1zyy
reviewed
Sep 23, 2022
|
|
||
| def parse_failure_reason(result) | ||
| return result.to_h[:error_details] || result.errors.presence | ||
| end |
Contributor
There was a problem hiding this comment.
This worked out well!
(Realistically this only makes sense for form response type objects, but I think it makes enough sense to just keep here, and a name like parse_failure_reason_from_form_response might be a bit much.)
n1zyy
approved these changes
Sep 23, 2022
Merged
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
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.
changelog: Internal, Attempts API, Standardize events