MCPcopy Index your code
hub / github.com/cockroachdb/errors / GetOneLineSource

Function GetOneLineSource

withstack_api.go:50–52  ·  view source on GitHub ↗

GetOneLineSource extracts the file/line/function information of the topmost caller in the innermost recorded stack trace. The filename is simplified to remove the path prefix. This is used e.g. to populate the "source" field in PostgreSQL errors in CockroachDB.

(err error)

Source from the content-addressed store, hash-verified

48// This is used e.g. to populate the "source" field in
49// PostgreSQL errors in CockroachDB.
50func GetOneLineSource(err error) (file string, line int, fn string, ok bool) {
51 return withstack.GetOneLineSource(err)
52}
53
54// GetReportableStackTrace extracts a stack trace embedded in the
55// given error in the format suitable for Sentry reporting.

Callers

nothing calls this directly

Calls 1

GetOneLineSourceFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…