( input: unknown, )
| 133 | // even for non-Error defects (including a CauseImpl defect, which gets |
| 134 | // wrapped via `causePrettyMessage`). |
| 135 | export 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 | |
| 147 | export const captureCause = ( |
| 148 | input: unknown, |
no outgoing calls
no test coverage detected