MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / sentryPayloadForCause

Function sentryPayloadForCause

apps/cloud/src/observability/index.ts:135–145  ·  view source on GitHub ↗
(
  input: unknown,
)

Source from the content-addressed store, hash-verified

133// even for non-Error defects (including a CauseImpl defect, which gets
134// wrapped via `causePrettyMessage`).
135export const sentryPayloadForCause = (
136 input: unknown,
137): { primary: unknown; pretty: string | null } => {
138 if (Cause.isCause(input)) {
139 const pretty = Cause.pretty(input);
140 const errors = Cause.prettyErrors(input);
141 // oxlint-disable-next-line executor/no-error-constructor -- boundary: Sentry captureException needs an Error-like primary payload for pretty Effect causes
142 return { primary: errors[0] ?? new Error(pretty), pretty };
143 }
144 return { primary: input, pretty: null };
145};
146
147export const captureCause = (
148 input: unknown,

Callers 2

captureCauseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected