🥅 Add ResponseParseError#parser_methods (and override #==)#615
Merged
Conversation
This also updates `ResponseParseError#==` to returns true when all attributes are equal, except for `#backtrace` and `#backtrace_locations` which are replaced with `#parser_methods`. This allows deserialized errors to be compared.
ResponseParseError#parser_methods (and override #==)
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.
Since most parser method names are based on rules in the IMAP grammar,
#parser_methodsis a quick way to figure out where the parsing got to, without needing to carefully read the#backtrace_locations. This basically just extracts the core of what the parser debug message has been doing for three years (bd2ddc0).This also updates
ResponseParseError#==to returns true when all attributes are equal, except for#backtraceand#backtrace_locationswhich are replaced with#parser_methods. This allows deserialized errors to be compared, which is primarily useful for testing.