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