Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased
### Added
- Add UnwrapFrame function to extract a single frame from an error.
- Add `UnwrapFrame` function to extract a single frame from an error.
You can use this to implement your own trace formatting logic.
- Support extracting trace frames from custom errors.
Any error value that implements `TracePC() uintptr` will now
contribute to the trace.
- Add `GetCaller` function for error helpers to annotate wrapped errors with
their caller information instead of the helper. Example:

```go
//go:noinline
func Wrapf(err error, msg string, args ...any) {
caller := errtrace.GetCaller()
err := ...
return caller.Wrap(err)
}
```

- cmd/errtrace:
Add `-no-wrapn` option to disable wrapping with generic `WrapN` functions.
This is only useful for toolexec mode due to tooling limitations.
Expand Down