{"modulePath":"github.com/chainloop-dev/chainloop","version":"v1.140.0","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package errorsx\n\nPackage errorsx creates errors that record the call stack where they start.\n\nGo errors carry no stack, so sentry-go gives an event the stack of the CaptureException call. Every failure reported from one place then shares one stack, and Sentry groups unrelated causes into one issue. An error from this package exposes its origin stack through StackTrace() \\[]uintptr, which sentry-go reads, so Sentry groups the event by where the failure started.\n\nUse New or Errorf where an error starts, and WithStack where an error from an external library enters the backend. Keep package-level sentinel errors as errors.New: a stack recorded at program start has no value.\n\ngithub.com/pkg/errors is not used: it is archived, its Errorf does not support %w, and its Wrap records a new stack on each wrap.\n\n## Functions\n\n```go\nfunc Errorf(format string, args ...any) error\n```\nErrorf formats like fmt.Errorf, %w included. It records the stack of the caller, unless a wrapped error already has a stack: the origin stack is the one that tells failures apart.\n\n```go\nfunc HasStack(err error) bool\n```\nHasStack reports whether err, or an error that it wraps, records a stack.\n\n```go\nfunc New(msg string) error\n```\nNew returns an error with the message msg and the stack of the caller.\n\n```go\nfunc WithStack(err error) error\n```\nWithStack adds the stack of the caller to err. It returns err unchanged when err is nil or already has a stack.\n\n","path":"github.com/chainloop-dev/chainloop/pkg/errorsx","name":"errorsx","synopsis":"Package errorsx creates errors that record the call stack where they start.","isRedistributable":true}
