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 f35f269
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions errors/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ 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 f35f269

Please sign in to comment.