MCPcopy Create free account
hub / github.com/juju/errors / SetLocation

Function SetLocation

functions.go:415–421  ·  view source on GitHub ↗

SetLocation takes a given error and records where in the stack SetLocation was called from and returns the wrapped error with the location information set. The returned error implements the Locationer interface. If err is nil then a nil error is returned.

(err error, callDepth int)

Source from the content-addressed store, hash-verified

413// set. The returned error implements the Locationer interface. If err is nil
414// then a nil error is returned.
415func SetLocation(err error, callDepth int) error {
416 if err == nil {
417 return nil
418 }
419
420 return newLocationError(err, callDepth)
421}
422
423// fmtNoop provides an internal type for wrapping errors so they won't be
424// printed in fmt type commands. As this type is used by the Hide function it's

Callers 2

TestSetLocationMethod · 0.92

Calls 1

newLocationErrorFunction · 0.85

Tested by 2

TestSetLocationMethod · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…