Change parser limit error to be gqlerror #371
Merged
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.
As reported by @hansod1 in github.com/99designs/gqlgen#3693
When in #291 we added the token limit, we should have used gqlerror to be more consistent
For reference, here is the change in gqlparser that added the new error.
As a result, the error is not as easy to detect as being from the parser because this part of the gqlgen codebase does not correctly interpret the token limit error as a parsing error because it is not returned from the parser as a
*gqlerror.Error
, and rather is anerrors.errorString
created withfmt.Errorf
:We should add a lint rule that bans
fmt.Errorf
and adds nolint comments for our remaining uses in our panics but I only got 3 hours of sleep so not doing that now.Signed-off-by: Steve Coffman steve@khanacademy.org