-
Notifications
You must be signed in to change notification settings - Fork 69
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
Support proper grouping for repanics #50
Comments
Ah yes, I'm aware I could probably |
After some more deliberation, I've come up with the following work-around: func bugsnagBeforeNotify(e *bugsnag.Event, c *bugsnag.Configuration) error {
// hack around impractical bugsnag grouping for re-panics:
// mark re-panic stuff on the stack as not InProject
var firstPanic int
for i, f := range e.Stacktrace {
if f.Method == "gopanic" {
firstPanic = i
}
}
for i := 0; i < firstPanic; i++ {
e.Stacktrace[i].InProject = false
}
return nil
} |
I apologize for the delay here, @EmielM. This is a great idea, and probably something we could do by default. On other platforms, we already handle nested causes automatically, and could probably do the same for Go, separating each instance of |
Our project uses quite a bit of
panic()
ing for flow control in http middlewares. Those middlewares functions try to recover from a panic, but only if it a panic they can handle (example: a db/tx middleware only handles panics that look like a db concurrency issues).If the error cannot be handled, the recovered value is
panic
ed again -- which in practice works quite well. Go simply adds any extra panic recovery to the stack, so the first panic point can be found if you just look far enough down.An example of a re
panic
raw stack trace submitted to bugsnag:The underlying problem here is
app/conv.go:151
where a nil pointer is deferenced. However, becausesqli/tx.go
re-panic
s, the error is currently grouped undersqli/tx.go:74
(runtime/
stuff is outsideProjectPackages
).I think in almost all cases the first (lowest) panic in the stack would be of most interest, so would expect the grouping logic to scan down the stack and look for the oldest panic, and then find the first function in a
ProjectPackage
below it.The text was updated successfully, but these errors were encountered: