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)
| 413 | // set. The returned error implements the Locationer interface. If err is nil |
| 414 | // then a nil error is returned. |
| 415 | func 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 |
searching dependent graphs…