getsentry / raven-go

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

Capture extra info using interface{ExtraInfo() map[string]interface{}} #168

Closed jsm closed 6 years ago

jsm commented 6 years ago

Goal

Surface a way to be able to capture extra information

Related Issues

https://github.com/getsentry/raven-go/pull/134 https://github.com/getsentry/raven-go/pull/138 https://github.com/getsentry/raven-go/pull/146

How is this different?

Public API Changes

raven.WrapWithExtra(err error, extraInfo map[string]interface{}) error
raven.NewPacketWithExtra(message string, extra Extra, interfaces ...Interface) *Packet

type Extra map[string]interface{}

type ErrWithExtra interface {
    Error() string
    Cause() error
    ExtraInfo() Extra
}
mattrobenolt commented 6 years ago

This is clever. Could we get some tests? Otherwise, looks good. :)

jheth commented 6 years ago

Can this be closed now that #190 landed?