Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(errors): extract pkg/errors stacktraces #144

Merged
merged 1 commit into from
Nov 3, 2020

Conversation

kattrali
Copy link
Contributor

@kattrali kattrali commented Nov 2, 2020

Goal

Support reporting stack traces captured using the pkg/errors package instead of generating a new stack when Notify() is called.

Closes #128 - updates the premise to use the latest pre-release branch and avoids adding go module files, which will be handled in a dedicated changeset.

Design

Create a new interface for objects implementing StackTrace(), returning an errors.StackTrace instance (which is an array of uintptr representing program counters). Given the array of program counters, the error can be processed normally.

Changeset

  • Added errorWithStack to represent the new error type (the errors package does not export this interface but it is listed as stable)

Testing

  • Added a new test for wrapping an error using the errors.Wrap() function, which generates a stack trace. This test verifies that the generated stack is used rather than creating a new one when [bugsnag.]errors.New() is called.

errors/error.go Outdated Show resolved Hide resolved
errors/error.go Show resolved Hide resolved
@kattrali kattrali merged commit 1559bde into next Nov 3, 2020
@kattrali kattrali deleted the kattrali/pkg-errors-support branch November 3, 2020 13:04
@kattrali kattrali mentioned this pull request Nov 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants