Skip to content

Commit fff3ceb

Browse files
committed
Issue #299: unclear error message in case of multiline strings
1 parent 4fe2a6b commit fff3ceb

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

internal/common/lexer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,5 +225,5 @@ func (l *Lexer) consumeComment() {
225225
}
226226

227227
func (l *Lexer) CatchScannerError(s *scanner.Scanner, msg string) {
228-
l.SyntaxError(fmt.Sprintf("%s. See near %s", msg, s.TokenText()))
228+
l.SyntaxError(msg)
229229
}

internal/common/lexer_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ var multilineStringTests = []consumeTestCase {
106106
description: "Multiline strings are not allowed",
107107
definition: `"Hello
108108
World"`,
109-
expected: `graphql: syntax error: literal not terminated. See near "Hello (line 1, column 1)`,
109+
expected: `graphql: syntax error: literal not terminated (line 1, column 1)`,
110110
failureExpected: true,
111111
useStringDescriptions: true,
112112
},

0 commit comments

Comments
 (0)