blob: e90ec40d05f5a0054d2d15aa69ab28f3d0c44701 [file] [log] [blame]
Serge Bazanskicc25bdf2018-10-25 14:02:58 +02001package jlexer
2
3import "fmt"
4
5// LexerError implements the error interface and represents all possible errors that can be
6// generated during parsing the JSON data.
7type LexerError struct {
8 Reason string
9 Offset int
10 Data string
11}
12
13func (l *LexerError) Error() string {
14 return fmt.Sprintf("parse error: %s near offset %d of '%s'", l.Reason, l.Offset, l.Data)
15}