const task = await client.pollTask(task_id, { intervalMs: 2_000, // how often to check (default 1_500) timeoutMs: 120_000, // give up after this long (default 120_000)});if (task.status === "failed") { throw new Error(task.error ?? "indexing failed");}
pollTask throws SfVoiceMediaPollTimeoutError if the task doesn’t reach ready or failed within the timeout.