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

Obtaining stack trace from the error as []uintptr #8

Open
mitar opened this issue Oct 9, 2023 · 1 comment
Open

Obtaining stack trace from the error as []uintptr #8

mitar opened this issue Oct 9, 2023 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@mitar
Copy link

mitar commented Oct 9, 2023

I made a spiritual successor of github.com/pkg/errors some time ago and in it I want to know if an error already contains a stack trace. The goal is that if a large codebase uses different packages for errors, they should work together and not hide existing recorded information, like a stack trace.

It seems this package does not expose the stack trace as []uintptr but only as a formatted string?

I would suggest that the following interface is implemented:

type stackTracer interface {
        StackTrace() []uintptr
}

Then, it is easy to obtain a stack trace, use it, format it. To me it looks like a simple type cast should be enough to do so?

@bwplotka
Copy link
Contributor

LGTM, thanks! Help wanted (:

@bwplotka bwplotka added the help wanted Extra attention is needed label Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants