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

Function logError

packages/vue/src/errorReporter.ts:70–91  ·  view source on GitHub ↗
(name: string)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

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…