@kepas/daraja-js
    Preparing search index...

    Function errorFromResponse

    • Build an error for a SYNCHRONOUS rejection (a non-success ResponseCode / dotted errorCode). Enriches the message from the catalog when the code is proven for this scope; otherwise uses Safaricom's errorMessage verbatim.

      Parameters

      • context: {
            errorCode?: string;
            errorMessage?: string;
            raw?: unknown;
            requestId?: string;
            responseCode?: string;
            scope: DarajaScope;
        }

      Returns DarajaAPIError