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

Function New

errutil_api.go:44–44  ·  view source on GitHub ↗

New creates an error with a simple error message. A stack trace is retained. Note: the message string is assumed to not contain PII and is included in Sentry reports. Use errors.Newf("%s", ) for errors strings that may contain PII information. Detail output: - message via `Error()` a

(msg string)

Source from the content-addressed store, hash-verified

42// - stack trace and message via `errors.GetSafeDetails()`.
43// - stack trace and message in Sentry reports.
44func New(msg string) error { return errutil.NewWithDepth(1, msg) }
45
46// NewWithDepth is like New() except the depth to capture the stack
47// trace is configurable.

Callers 7

TestJoinFunction · 0.92
BenchmarkErrorsIsFunction · 0.92
TestWithContextFunction · 0.92
server_test.goFile · 0.92
ErrorFunction · 0.92
TestAsFunction · 0.92

Calls 1

NewWithDepthFunction · 0.92

Tested by 5

TestJoinFunction · 0.74
BenchmarkErrorsIsFunction · 0.74
TestWithContextFunction · 0.74
TestAsFunction · 0.74