Skip to content

Commit

Permalink
PR FIXUP - Document withStackTrace
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewSisley committed Dec 20, 2022
1 parent dae4290 commit 15380b0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions errors/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ func newError(message string, depthToSkip int, keyvals ...KV) *defraError {
return withStackTrace(message, depthToSkip+1, keyvals...)
}

// withStackTrace creates a `defraError` with a stacktrace and the given key-value pairs.
// The stacktrace will skip the top `depthToSkip` frames, allowing frames/calls generated from
// within this package to not polute the resultant stacktrace.
//
// This function will not be inlined by the compiler as it will spoil any stacktrace
// generated.
//go:noinline
Expand Down

0 comments on commit 15380b0

Please sign in to comment.