Effect.catchAllCause(cause => {
const maybeRetriableMongoError = Cause.find(
cause,
error => {
const squashed = Cause.squash(error)
return isRetriableTransactionError(squashed)
? Option.some(squashed)
: Option.none()
}
)
// then surface the error to typed channel if Some (so it can be later retried)
// or die|fail otherwise
Effect.catchAllCause(cause => {
const maybeRetriableMongoError = Cause.find(
cause,
error => {
const squashed = Cause.squash(error)
return isRetriableTransactionError(squashed)
? Option.some(squashed)
: Option.none()
}
)
// then surface the error to typed channel if Some (so it can be later retried)
// or die|fail otherwise