explainMetaError (whatsapp/meta-error-explain.ts)

wacrm · src/lib/whatsapp/meta-error-explain.ts · typescript · MIT
integration

Translates Meta Graph API errors into actionable, user‑friendly explanations.

// Source: https://github.com/ArnasDon/wacrm | License: MIT | Copyright 2026 Arnas Donauskas
// Provided via justclaw.it.com; keep this notice with the code.
/**
 * Turn a Meta Graph API failure into something a person can act on.
 *
 * Meta's error envelope is precise but terse — "(#100) Unsupported get
 * request" says nothing about *which* of the four values on the settings
 * form is wrong. This module maps `code` / `error_subcode` (plus the
 * step of the connect flow that failed) onto: a plain-English summary,
 * the form field to check, and whether the fix is on the user's side
 * (HTTP 400) or Meta's (HTTP 502). The raw code, subcode and
 * `fbtrace_id` ride along so the user can quote them to Meta support.
 *
 * Pure — no I/O, no env. Issue #505.
 *
 * Error codes: https://develop

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key