Flatten and check exception class whitelisting with a method#632
Merged
lgebhardt merged 1 commit intoJSONAPI-Resources:masterfrom Feb 26, 2016
Merged
Conversation
* Move repeated code to a new method * Add #flatten to the chain to avoid situations where a nested array is silently accepted, but exceptions are not passed through
lgebhardt
added a commit
that referenced
this pull request
Feb 26, 2016
Flatten and check exception class whitelisting with a method
Contributor
|
@vijoc Thanks! |
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.
I just spent an embarrassingly long time chasing down the reason why my exceptions were not passed through, after adding them to the configuration as
config.exception_class_whitelist << [MyError]. This, of course, caused a nested Array to be stored and the checks failed to account for that.This PR extracts the exception class whitelist checking to a new method and adds a
flattento the chain to avoid just these kinds of situations.