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

Function sentryPayloadForCause

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

Source from the content-addressed store, hash-verified

247// even for non-Error defects (including a CauseImpl defect, which gets
248// wrapped via `causePrettyMessage`).
249export const sentryPayloadForCause = (
250 input: unknown,
251): { primary: unknown; pretty: string | null } => {
252 if (Cause.isCause(input)) {
253 const pretty = Cause.pretty(input);
254 const errors = Cause.prettyErrors(input);
255 // oxlint-disable-next-line executor/no-error-constructor -- boundary: Sentry captureException needs an Error-like primary payload for pretty Effect causes
256 return { primary: errors[0] ?? new Error(pretty), pretty };
257 }
258 return { primary: input, pretty: null };
259};
260
261// Safe classification fields our tagged errors carry (`UserStoreError.operation`
262// / `.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