Skip to content

errorFromResponse

errorFromResponse(httpStatus, envelope, bodyText?): WhatsAppApiError

Defined in: src/errors.ts:233

Builds a WhatsAppApiError (or WhatsAppAuthenticationError) from a non-2xx response. The envelope is used when parseable; otherwise bodyText and the status drive a generic API error.

number

GraphErrorEnvelope | undefined

string

WhatsAppApiError

Independent open-source project. Not affiliated with, endorsed by or sponsored by Meta or WhatsApp. Released under the MIT licence. Source on GitHub.