(op: string, fn: (wos: WorkOS) => Promise<A>)
| 425 | // span reads `workos.<operation>` instead of one undifferentiated "workos" |
| 426 | // bucket, and failures log which call actually failed. |
| 427 | const use = <A>(op: string, fn: (wos: WorkOS) => Promise<A>) => |
| 428 | withServiceLogging( |
| 429 | `workos.${op}`, |
| 430 | workosErrorFromFailure, |
| 431 | tryPromiseService(() => fn(workos)), |
| 432 | ); |
| 433 | |
| 434 | // MFA SDK errors can contain response details. Keep only the status before |
| 435 | // logging, so enrollment secrets and submitted codes cannot enter a cause. |