(f: () => Promise<A>)
| 49 | // `DatabaseError` (transient-classified) instead of a bare-`Error` defect — the |
| 50 | // latter both bypasses retry and breaks JSON encoding of the failure channel. |
| 51 | const tryCosmos = <A>(f: () => Promise<A>): Effect.Effect<A, DatabaseError> => |
| 52 | Effect.tryPromise({ |
| 53 | try: f, |
| 54 | catch: (e) => |
| 55 | new DatabaseError({ |
| 56 | message: `Cosmos request failed: ${e instanceof Error ? e.message : String(e)}`, |
| 57 | transient: thrownIsTransient(e), |
| 58 | cause: e |
| 59 | }) |
| 60 | }) |
| 61 | |
| 62 | const respBytes = ( |
| 63 | resp: { diagnostics?: { clientSideRequestStatistics?: { totalResponsePayloadLengthInBytes?: number } } } |
no test coverage detected
searching dependent graphs…