waitFor is a method on the client returned by createClient. Its return type depends on the target:
Parameters
WaitForTarget
required
Select the operation and supply its ID. IDs accept strings.
WaitForOptions
default:"{}"
Polling limits.
Returns
Promise
The final fetched resource, not only its
result property.failed job is returned, not thrown. Inspect its error. See long-running jobs for upload finalization and alternative polling methods.
Throws
PotatoApiErrorwithcode: "wait_timeout"andbody: { timeoutMs }when the timeout expires.PotatoApiErrorwithcode: "http"when a polling request fails.- A local error for invalid polling options, or when
datasetSplitcannot find the named split field. - Other errors from
fetchor the credential callback are passed through.