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

Function logError

packages/infra/src/errorReporter.ts:73–90  ·  view source on GitHub ↗
(name: string)

Source from the content-addressed store, hash-verified

71}
72
73export function logError<E>(name: string) {
74 return Effect.fnUntraced(
75 function*(cause: Cause.Cause<E>, extras?: Record<string, unknown>) {
76 if (Cause.hasInterruptsOnly(cause)) {
77 yield* InfraLogger.logDebug("Interrupted").pipe(Effect.annotateLogs(dropUndefined({ extras })))
78 return
79 }
80 yield* InfraLogger
81 .logWarning("Logging error", cause)
82 .pipe(Effect.annotateLogs(dropUndefined({
83 extras,
84 cause: tryToJson(cause),
85 __error_name__: name
86 })))
87 },
88 (effect) => Effect.tapCause(effect, () => InfraLogger.logFatal("Failed to log error cause"))
89 )
90}
91
92export const reportMessage = Effect.fnUntraced(function*(message: string, extras?: Record<string, unknown>) {
93 const context = yield* getRC

Callers 2

tapErrorCauseFunction · 0.90
middleware.tsFile · 0.90

Calls 3

dropUndefinedFunction · 0.90
tryToJsonFunction · 0.90
pipeMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…