setErr is called from parsing action rules to register an error observed while running the action. That error becomes the actual "cause" of the syntax error.
(err error)
| 589 | // while running the action. That error becomes the actual "cause" of the |
| 590 | // syntax error. |
| 591 | func (l *lexer) setErr(err error) { |
| 592 | err = pgerror.WithCandidateCode(err, pgcode.Syntax) |
| 593 | l.lastError = err |
| 594 | lastTok := l.lastToken() |
| 595 | l.lastError = parser.PopulateErrorDetails(lastTok.id, lastTok.str, lastTok.pos, l.lastError, l.in) |
| 596 | } |
| 597 | |
| 598 | // setErrNoDetails is similar to setErr, but is used for an error that should |
| 599 | // not be further annotated with details. If there is no candidate code for the |
no test coverage detected