MongoDB event store implements its own VersionError and a IsConsistencyError() function. Aggregates that implement repository.Retryer must use the MongoDB-specific function if the MongoDB event store is used. There should be a single aggregate.IsConsistencyError function to check for consistency errors. Implementation-specific errors can then provide a function to tell the aggregate.IsConsistencyError() function if the error is a consistency error.
repository.Retryer.RetryUse() can then return a single value because we can just use the aggregate.IsConsistencyError() function to check if the operation should be retried.
MongoDB event store implements its own
VersionError
and aIsConsistencyError()
function. Aggregates that implementrepository.Retryer
must use the MongoDB-specific function if the MongoDB event store is used. There should be a singleaggregate.IsConsistencyError
function to check for consistency errors. Implementation-specific errors can then provide a function to tell theaggregate.IsConsistencyError()
function if the error is a consistency error.