(name: string)
| 71 | } |
| 72 | |
| 73 | export 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 | |
| 92 | export const reportMessage = Effect.fnUntraced(function*(message: string, extras?: Record<string, unknown>) { |
| 93 | const context = yield* getRC |
no test coverage detected
searching dependent graphs…