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

Function WithDomain

domains/domains.go:57–62  ·  view source on GitHub ↗

WithDomain wraps an error so that it appears to come from the given domain. Domain is shown: - via `errors.GetSafeDetails()`. - when formatting with `%+v`. - in Sentry reports.

(err error, domain Domain)

Source from the content-addressed store, hash-verified

55// - when formatting with `%+v`.
56// - in Sentry reports.
57func WithDomain(err error, domain Domain) error {
58 if err == nil {
59 return nil
60 }
61 return &withDomain{cause: err, domain: domain}
62}
63
64// New creates an error in the implicit domain (see PackageDomain() below)
65// of its caller.

Callers 13

WithDomainFunction · 0.92
TestNamedDomainFunction · 0.92
TestWrappedDomainFunction · 0.92
TestWithDomainFunction · 0.92
TestHandledFunction · 0.92
TestFormatFunction · 0.92
NewErrorFunction · 0.92
TestReportFunction · 0.92
datadriven_test.goFile · 0.92
NewFunction · 0.70
HandledInDomainFunction · 0.70

Calls

no outgoing calls

Tested by 7

TestNamedDomainFunction · 0.74
TestWrappedDomainFunction · 0.74
TestWithDomainFunction · 0.74
TestHandledFunction · 0.74
TestFormatFunction · 0.74
TestReportFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…