MCPcopy Create free account
hub / github.com/effect-app/libs / isCosmosStatus

Function isCosmosStatus

packages/infra/src/WorkflowEngineCosmos.ts:125–128  ·  view source on GitHub ↗
(u: unknown, code: number)

Source from the content-addressed store, hash-verified

123// returning the status code (only `read` and batch ops surface codes), so OCC
124// conflicts must be matched on the thrown error — mirrors ClusterCosmos.
125const isCosmosStatus = (u: unknown, code: number): boolean =>
126 Cause.isUnknownError(u)
127 ? isCosmosStatus(u.cause, code)
128 : typeof u === "object" && u !== null && "code" in u && u.code === code
129
130const isOptimisticError = (u: unknown) => isCosmosStatus(u, 409) || isCosmosStatus(u, 412) || isCosmosStatus(u, 404)
131

Callers 1

isOptimisticErrorFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…