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

Function sentryPayloadForCause

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

Source from the content-addressed store, hash-verified

256// even for non-Error defects (including a CauseImpl defect, which gets
257// wrapped via `causePrettyMessage`).
258export const sentryPayloadForCause = (
259 input: unknown,
260): { primary: unknown; pretty: string | null } => {
261 if (Cause.isCause(input)) {
262 const pretty = Cause.pretty(input);
263 const errors = Cause.prettyErrors(input);
264 // oxlint-disable-next-line executor/no-error-constructor -- boundary: Sentry captureException needs an Error-like primary payload for pretty Effect causes
265 return { primary: errors[0] ?? new Error(pretty), pretty };
266 }
267 return { primary: input, pretty: null };
268};
269
270// Safe classification fields our tagged errors carry (`UserStoreError.operation`
271// / `.reason`, `WorkOSError.status`). They are promoted to Sentry TAGS because

Callers 2

captureCauseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected