jlexer/error.go
raw| 1 | package jlexer |
| 2 | |
| 3 | import "fmt" |
| 4 | |
| 5 | // LexerError implements the error interface and represents all possible errors that can be |
| 6 | // generated during parsing the JSON data. |
| 7 | type LexerError struct { |
| 8 | Reason string |
| 9 | Offset int |
| 10 | Data string |
| 11 | } |
| 12 | |
| 13 | func (l *LexerError) Error() string { |
| 14 | return fmt.Sprintf("parse error: %s near offset %d of '%s'", l.Reason, l.Offset, l.Data) |
| 15 | } |