Skip to content

Commit 6b0a781

Browse files
committed
refactor(server): catch the projection transaction error with catchTags
Matches the repository's Effect convention for statically known tagged failures.
1 parent e54c28b commit 6b0a781

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

‎apps/server/src/orchestration/Layers/ProjectionPipeline.ts‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2123,13 +2123,12 @@ const makeOrchestrationProjectionPipeline = Effect.fn("makeOrchestrationProjecti
21232123
const projectEvent: OrchestrationProjectionPipelineShape["projectEvent"] = Effect.fn(
21242124
"projectEvent",
21252125
)(function* (event) {
2126-
const cleanup = yield* sql
2127-
.withTransaction(projectEventDeferred(event))
2128-
.pipe(
2129-
Effect.catchTag("SqlError", (sqlError) =>
2126+
const cleanup = yield* sql.withTransaction(projectEventDeferred(event)).pipe(
2127+
Effect.catchTags({
2128+
SqlError: (sqlError) =>
21302129
Effect.fail(toPersistenceSqlError("ProjectionPipeline.projectEvent:query")(sqlError)),
2131-
),
2132-
);
2130+
}),
2131+
);
21332132
yield* cleanup;
21342133
});
21352134

0 commit comments

Comments
 (0)