mirror of
https://github.com/zitadel/zitadel.git
synced 2025-11-14 08:34:05 +00:00
fix: add sentry in ui, http and projection handlers (#1977)
* fix: add sentry in ui, http and projection handlers * fix test
This commit is contained in:
@@ -2,9 +2,12 @@ package query
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/caos/zitadel/internal/eventstore/v1"
|
||||
"time"
|
||||
|
||||
"github.com/getsentry/sentry-go"
|
||||
|
||||
"github.com/caos/zitadel/internal/eventstore/v1"
|
||||
|
||||
"github.com/caos/logging"
|
||||
|
||||
"github.com/caos/zitadel/internal/eventstore/v1/models"
|
||||
@@ -27,9 +30,19 @@ type Handler interface {
|
||||
AggregateTypes() []models.AggregateType
|
||||
CurrentSequence() (uint64, error)
|
||||
Eventstore() v1.Eventstore
|
||||
|
||||
Subscription() *v1.Subscription
|
||||
}
|
||||
|
||||
func ReduceEvent(handler Handler, event *models.Event) {
|
||||
defer func() {
|
||||
err := recover()
|
||||
|
||||
if err != nil {
|
||||
sentry.CurrentHub().Recover(err)
|
||||
handler.Subscription().Unsubscribe()
|
||||
}
|
||||
}()
|
||||
currentSequence, err := handler.CurrentSequence()
|
||||
if err != nil {
|
||||
logging.Log("HANDL-BmpkC").WithError(err).Warn("unable to get current sequence")
|
||||
|
||||
Reference in New Issue
Block a user