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

Function reportSentry

packages/infra/src/errorReporter.ts:55–71  ·  view source on GitHub ↗
(
  error: CauseException<unknown>,
  extras: Record<string, unknown> | undefined,
  level: Sentry.SeverityLevel = "error"
)

Source from the content-addressed store, hash-verified

53}
54
55function reportSentry(
56 error: CauseException<unknown>,
57 extras: Record<string, unknown> | undefined,
58 level: Sentry.SeverityLevel = "error"
59) {
60 return getRC.pipe(Effect.map((context) => {
61 const scope = new Sentry.Scope()
62 scope.setLevel(level)
63 if (context) scope.setContext("context", { ...context })
64 if (extras) scope.setContext("extras", extras)
65 const squashed = Cause.squash(error.originalCause)
66 scope.setContext("mainError", tryToJson(squashed))
67 scope.setContext("error", tryToReport(error))
68 scope.setContext("cause", tryToJson(error.originalCause))
69 Sentry.captureException(error, scope)
70 }))
71}
72
73export function logError<E>(name: string) {
74 return Effect.fnUntraced(

Callers 1

reportErrorFunction · 0.70

Calls 5

tryToJsonFunction · 0.90
tryToReportFunction · 0.90
pipeMethod · 0.65
mapMethod · 0.65
setContextMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…