Skip to main content
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.
A failed job is returned, not thrown. Inspect its error. See long-running jobs for upload finalization and alternative polling methods.

Throws

  • PotatoApiError with code: "wait_timeout" and body: { timeoutMs } when the timeout expires.
  • PotatoApiError with code: "http" when a polling request fails.
  • A local error for invalid polling options, or when datasetSplit cannot find the named split field.
  • Other errors from fetch or the credential callback are passed through.