migrate remaining errors to new model #108
Open
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.
The
EncodingError
andParseIndexError
types are parsing errors with awell defined 'subject', but they weren't previously made into
Diagnostic
implementors, so they worked a bit inconsistently with other error types. This
PR makes it so those errors follow the same conventions and general structure
used by its kindred.
There is one related breaking change:
InvalidCharacterError
previously helda copy of the subject, but in the new model this is a responsibility of its
enriched
Report<InvalidCharacterError>
type. Since some methods directlydepended on access to the subject, they had to be removed. I think this is
justifiable since the new error APIs are already breaking (we just should've
made this change in tandem with the other related breaks).
I don't have any other error-related breaks planned.
This PR also incidentally fixes an incorrect error type returned if the token ended with a
~
(it would be flagged as a slash error, not tilde). I updated tests to cover this.