Skip to content

apiErrorFromResponse

function apiErrorFromResponse(res): Promise<DropInApiError>;

Turn a failed Response from the dropin API into a DropInApiError. Exported so @dropinnodex/server — and anyone proxying these routes — produces the exact same error object from the exact same body, rather than a second, drifting copy of this parse. Consumes the body, so pass a Response you have not read yet.

Parameter Type
res Response

Promise<DropInApiError>