( input: unknown, )
| 256 | // even for non-Error defects (including a CauseImpl defect, which gets |
| 257 | // wrapped via `causePrettyMessage`). |
| 258 | export 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 |
no outgoing calls
no test coverage detected