European Parliament MCP Server API - v1.2.21
    Preparing search index...

    Function extractUpstreamStatusCode

    • Parse an HTTP status code from an EP API error-in-body message.

      EP API error-in-body messages often embed the HTTP status code in the error string, e.g. "404 Not Found from POST …" or "502 Bad Gateway from …". This function extracts the first three-digit integer in the range 100–599.

      Parameters

      • errorMessage: string

        Raw error string from the EP API response body

      Returns number | undefined

      The numeric HTTP status code, or undefined if none is found