mirror of
https://github.com/zitadel/zitadel.git
synced 2025-01-10 20:23:41 +00:00
15 lines
350 B
Go
15 lines
350 B
Go
package projection
|
|
|
|
import (
|
|
"github.com/zitadel/zitadel/internal/errors"
|
|
"github.com/zitadel/zitadel/internal/eventstore"
|
|
)
|
|
|
|
func assertEvent[T eventstore.Event](event eventstore.Event) (T, error) {
|
|
e, ok := event.(T)
|
|
if !ok {
|
|
return e, errors.ThrowInvalidArgumentf(nil, "HANDL-1m9fS", "reduce.wrong.event.type %T", event)
|
|
}
|
|
return e, nil
|
|
}
|