Other: Ensure context is string in sentry reports

This commit is contained in:
James Houlahan
2022-11-29 12:59:00 +01:00
parent 7510ba2541
commit e71e56f7fe
6 changed files with 131 additions and 12 deletions

View File

@ -138,7 +138,7 @@ func (r *Reporter) scopedReport(context map[string]interface{}, doReport func())
scope.SetTags(tags)
if len(context) != 0 {
scope.SetContexts(
map[string]map[string]interface{}{"bridge": context},
map[string]sentry.Context{"bridge": contextToString(context)},
)
}
doReport()
@ -204,3 +204,13 @@ func isFunctionFilteredOut(function string) bool {
func Flush(maxWaiTime time.Duration) {
sentry.Flush(maxWaiTime)
}
func contextToString(context sentry.Context) sentry.Context {
res := make(sentry.Context)
for k, v := range context {
res[k] = fmt.Sprintf("%v", v)
}
return res
}