Promote saga error→ProjectionError helper to @octant/event-sourcing #46
Labels
No labels
bug
enhancement
pr-split
question
security
transaction-matcher
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
momsse/octant#46
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Transverse refactor surfaced repeatedly in reviews (#100, #32 local review).
The
describe*Error+to*ProjectionErrorpair is now duplicated three times, byte-identical except for the source-error union:packages/domain/authorization/src/application/sagas/cascade-saga-error.tspackages/application/transaction-matching/src/sagas/saga-error.tspackages/domain/banking/src/application/sagas/banking-saga-error.tsThe
ConcurrencyErrorformatting branch and the factory are identical; only the union of decide errors differs. A format change to one silently drifts from the others.Proposed work
Add a generic
toProjectionError(projectionName, prefix)to@octant/event-sourcing(next towrapEventStoreErrorinprojection.ts) that handles theConcurrencyErrorbranch and themessage-or-JSON.stringifyfallback over any{ _tag; message }error, then adopt it in all three saga families and delete the local copies.Scope note
Touches three already-merged packages, so kept out of the #32 PR. Pure refactor; behaviour-preserving.