EU Parliament Monitor — API Documentation - v0.9.24
    Preparing search index...

    Function redactSubscriptionKeys

    • Remove any configured IMF subscription keys from an Error's message and stack so that downstream console.warn / fallback envelopes cannot leak the secret even if the underlying fetch implementation embeds request headers in its thrown error.

      Parameters

      • error: Error

        Error returned by fetchImpl or constructed from a non-Error throw.

      • keys: readonly string[]

        IMF subscription keys to redact.

      Returns Error

      A new Error whose message (and stack when present) have each configured subscription key replaced with [REDACTED]. Returns the original error untouched when no keys are configured.