(filename, in string, loc int, err error)
| 23 | } |
| 24 | |
| 25 | func (e *Error) Add(filename, in string, loc int, err error) { |
| 26 | line := 1 |
| 27 | column := 1 |
| 28 | if lerr, ok := err.(*sqlerr.Error); ok { |
| 29 | if lerr.Location != 0 { |
| 30 | loc = lerr.Location |
| 31 | } else if lerr.Line != 0 && lerr.Column != 0 { |
| 32 | line = lerr.Line |
| 33 | column = lerr.Column |
| 34 | } |
| 35 | } |
| 36 | if in != "" && loc != 0 { |
| 37 | line, column = source.LineNumber(in, loc) |
| 38 | } |
| 39 | e.errs = append(e.errs, &FileError{filename, line, column, err}) |
| 40 | } |
| 41 | |
| 42 | func (e *Error) Errs() []*FileError { |
| 43 | return e.errs |