Skip to content

Commit

Permalink
Issue graph-gophers#299: unclear error message in case of multiline s…
Browse files Browse the repository at this point in the history
…trings
  • Loading branch information
suntoucha committed Oct 7, 2020
1 parent 4fe2a6b commit fff3ceb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/common/lexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,5 +225,5 @@ func (l *Lexer) consumeComment() {
}

func (l *Lexer) CatchScannerError(s *scanner.Scanner, msg string) {
l.SyntaxError(fmt.Sprintf("%s. See near %s", msg, s.TokenText()))
l.SyntaxError(msg)
}
2 changes: 1 addition & 1 deletion internal/common/lexer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ var multilineStringTests = []consumeTestCase {
description: "Multiline strings are not allowed",
definition: `"Hello
World"`,
expected: `graphql: syntax error: literal not terminated. See near "Hello (line 1, column 1)`,
expected: `graphql: syntax error: literal not terminated (line 1, column 1)`,
failureExpected: true,
useStringDescriptions: true,
},
Expand Down

0 comments on commit fff3ceb

Please sign in to comment.