func reportMessage(ctx context.Context, sentryClient *raven.Client, msg string) { if sentryClient != nil { req, ok := reqcontext.ReqFromContext(ctx) if ok { sentryClient.CaptureMessage(msg, map[string]string{}, raven.NewHttp(req)) } else { sentryClient.CaptureMessage(msg, map[string]string{}) } } log.Printf("[Sentry Message] %v\n", msg) }
func reportError(ctx context.Context, sentryClient *raven.Client, err error) { if sentryClient != nil { req, ok := reqcontext.ReqFromContext(ctx) if ok { sentryClient.CaptureError(err, map[string]string{}, raven.NewHttp(req)) } else { sentryClient.CaptureError(err, map[string]string{}) } } log.Printf("[Sentry Error] %v\n", err) }