MCPcopy Create free account
hub / github.com/cockroachdb/cockroachdb-parser / setErr

Method setErr

pkg/sql/plpgsql/parser/lexer.go:591–596  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

589// while running the action. That error becomes the actual "cause" of the
590// syntax error.
591func (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

Callers 1

setErrFunction · 0.45

Calls 3

lastTokenMethod · 0.95
WithCandidateCodeFunction · 0.92
PopulateErrorDetailsFunction · 0.92

Tested by

no test coverage detected