fix(handler): report error correctly (#9926)

# Which Problems Are Solved

1. The projection handler reported no error if an error happened but
updating the current state was successful. This can lead to skipped
projections during setup as soon as the projection has an error but does
not correctly report if to the caller.

2. Mirror projections skipped as soon as an error occures, this leads to
unprojected projections.

3. Mirror checked position wrongly in some cases

# How the Problems Are Solved

1. the error returned by the `Trigger` method will will only be set to
the error of updating current states if there occured an error.

2. triggering projections checks for the error type returned and retries
if the error had code `23505`

3. Corrected to use the `Equal` method

# Additional Changes

unify logging on mirror projections
This commit is contained in:
Silvan
2025-05-26 11:55:30 +02:00
committed by GitHub
parent 6d33f9e75a
commit f0ff638db7
7 changed files with 63 additions and 17 deletions

View File

@@ -64,6 +64,10 @@ func CloseTransaction(tx Tx, err error) error {
return commitErr
}
const (
PgUniqueConstraintErrorCode = "23505"
)
type Config struct {
Dialects map[string]interface{} `mapstructure:",remain"`
connector dialect.Connector