getsentry / raven-go

Sentry client in Go
https://sentry.io
BSD 3-Clause "New" or "Revised" License
561 stars 147 forks source link

Support extracting extra infromation from errors without Cause() #240

Closed jwagner closed 5 years ago

jwagner commented 5 years ago

The current implementation of extractExtra() requires an interface containing both Cause() and ExtraInfo(). This means that no ExtraInfo() can be extracted from root causes..

I'm not 100% sure if this change is backwards compatible for lack of knowledge of Go but from all I know it should be.

kamilogorek commented 5 years ago

Looks good, thanks!

giautm commented 5 years ago

I really dont like to import getsentry/raven-go to just reference to raven.Extra to implement ExtraInfo() Extra. Can we simplify by define ExtraInfo() map[string]interface{} instead?

jwagner commented 5 years ago

@giautm I thought about that too. The problem is that it breaks API compatibility unless a type alias is used but since Go 1.7 needs to be supported that won't work either. I guess it would be possibly to define yet another Interface and keep the old one around for backwards compatibility until the next major it seems a bit messy too but would probably be the route I'd take.