MCPcopy Create free account
hub / github.com/rilldata/rill / newDuckDBError

Function newDuckDBError

runtime/parser/parser.go:1220–1237  ·  view source on GitHub ↗

newDuckDBError wraps a DuckDB parser error, extracting line number information if available

(err error)

Source from the content-addressed store, hash-verified

1218
1219// newDuckDBError wraps a DuckDB parser error, extracting line number information if available
1220func newDuckDBError(err error) error {
1221 res := duckDBErrLineRegexp.FindStringSubmatch(err.Error())
1222 if len(res) != 2 {
1223 return err
1224 }
1225
1226 line, err2 := strconv.ParseUint(res[1], 10, 32)
1227 if err2 != nil {
1228 return err
1229 }
1230
1231 return locationError{
1232 err: err,
1233 location: &runtimev1.CharLocation{
1234 Line: uint32(line),
1235 },
1236 }
1237}

Callers 1

inferSQLRefsMethod · 0.85

Calls 1

ErrorMethod · 0.45

Tested by

no test coverage detected