(name: string)
| 68 | } |
| 69 | |
| 70 | export 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 | |
| 93 | export function captureException(error: unknown, extras?: Record<string, unknown>) { |
| 94 | const scope = new Sentry.Scope() |
nothing calls this directly
no test coverage detected
searching dependent graphs…