APIError, including through asResponse().
Extends
Promise<T>
Type Parameters
T
T
Constructors
Constructor
Parameters
responsePromise
Promise<Response>
parseResponse
(response) => Promise<T>
Returns
APIPromise<T>
Overrides
Methods
asResponse()
Response without parsing the body. SDK requests buffer the full
body under the request timeout before handoff; reading it afterwards is caller-owned.
The caller owns the body; don’t also await the parsed result on the same promise.
Returns
Promise<Response>
catch()
Type Parameters
TResult
TResult = never
Parameters
onrejected?
((reason) => TResult | PromiseLike<TResult>) | null
The callback to execute when the Promise is rejected.
Returns
Promise<T | TResult>
A Promise for the completion of the callback.
Overrides
finally()
Parameters
onfinally?
(() =>void) | null
The callback to execute when the Promise is settled (fulfilled or rejected).
Returns
Promise<T>
A Promise for the completion of the callback.
Overrides
map()
Type Parameters
U
U
Parameters
fn
(data) => U
Returns
APIPromise<U>
then()
Type Parameters
TResult1
TResult1 = T
TResult2
TResult2 = never
Parameters
onfulfilled?
((value) => TResult1 | PromiseLike<TResult1>) | null
The callback to execute when the Promise is resolved.
onrejected?
((reason) => TResult2 | PromiseLike<TResult2>) | null
The callback to execute when the Promise is rejected.
Returns
Promise<TResult1 | TResult2>
A Promise for the completion of which ever callback is executed.
Overrides
withResponse()
Returns
Promise<WithResponse<T>>
