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

    Class EPAPIError

    EP API error for European Parliament API failures

    Thrown when the European Parliament API returns an error or when communication with the API fails. Preserves the original status code from the upstream API.

    const response = await fetch(epApiUrl);
    if (!response.ok) {
    throw new EPAPIError(
    'Failed to fetch MEP data',
    response.status,
    { url: epApiUrl, status: response.statusText }
    );
    }

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Constructors

    • Create a new EP API error

      Parameters

      • message: string

        Description of API failure

      • statusCode: number

        HTTP status code from EP API

      • Optionaldetails: unknown

        Optional details about the failure

      Returns EPAPIError

    Properties

    code: string

    Machine-readable error code (e.g., 'VALIDATION_ERROR')

    statusCode: number = 500

    HTTP status code (default: 500)

    details?: unknown

    Optional additional error details for debugging