MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / withServiceLogging

Function withServiceLogging

apps/cloud/src/auth/errors.ts:48–57  ·  view source on GitHub ↗
(
  name: string,
  publicError: () => E,
  effect: Effect.Effect<A, unknown, R>,
)

Source from the content-addressed store, hash-verified

46 * public shape.
47 */
48export const withServiceLogging = <A, E, R>(
49 name: string,
50 publicError: () => E,
51 effect: Effect.Effect<A, unknown, R>,
52): Effect.Effect<A, E, R> =>
53 effect.pipe(
54 Effect.tapCause((cause) => Effect.logError(`${name} failed`, cause)),
55 Effect.mapError(publicError),
56 Effect.withSpan(name),
57 ) as Effect.Effect<A, E, R>;

Callers 2

makeServiceFunction · 0.90
useFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected