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

Grouping errors by *errors.errorString #17

Closed
jbowens opened this issue Mar 31, 2015 · 3 comments
Closed

Grouping errors by *errors.errorString #17

jbowens opened this issue Mar 31, 2015 · 3 comments

Comments

@jbowens
Copy link

jbowens commented Mar 31, 2015

The error class to be sent to Bugsnag. This defaults to the type name of the Error, for
example *error.String

https://github.com/bugsnag/bugsnag-go/blob/master/event.go#L55

It's pretty common in Go to use errors.New and fmt.Errorf very liberally, rarely creating your own types for errors. If you do that, bugsnag will group by the ErrorClass, resulting in a bunch of very different errors being grouped together. Can we add a way to configure this?

@ConradIrwin
Copy link
Contributor

It'll only group them together if they happen from the same line of code, so it's not too too bad.

Happy to think about ways of making this better. From past experience just using the message is terrible, as messages are too unique so you end up with the opposite problem.

@ConradIrwin
Copy link
Contributor

Going to close this, as I think the best way is just to use a custom error type.

@lgonzalez-silen
Copy link

In case someone else gets to here because grouping is too broad, the key ingredient for correct grouping is to set ProjectPackages in your configuration to a suitable value (e.g. []string{"github.com/yourco/yourproj/**"}) as the grouping goes by the top most line that's in-project, but if it finds nothing in-project it will just use the top line which is likely something like

runtime/panic.go:489 gopanic

(or maybe it just skips the top file:line and uses the error class exclusively?)

making everything sharing an error class group together.

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

No branches or pull requests

3 participants