mirror of
https://github.com/netbirdio/easyjson.git
synced 2026-05-22 18:44:42 -07:00
Added AddMultipleError func
This commit is contained in:
@@ -1026,6 +1026,14 @@ func (r *Lexer) AddError(e error) {
|
||||
}
|
||||
}
|
||||
|
||||
func (r *Lexer) AddMultipleError(e error) {
|
||||
r.addNonfatalError(&LexerError{
|
||||
Offset: r.start,
|
||||
Data: string(r.Data[r.start:r.pos]),
|
||||
Reason: e.Error(),
|
||||
})
|
||||
}
|
||||
|
||||
func (r *Lexer) addNonfatalError(err *LexerError) {
|
||||
if r.UseMultipleErrors {
|
||||
// We don't want to add errors with the same offset.
|
||||
|
||||
Reference in New Issue
Block a user