Exemplo n.º 1
0
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)
}
Exemplo n.º 2
0
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)
}