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

    Function withTimeoutConfig

    • Execute a promise with timeout settings from a TimeoutConfig.

      Convenience wrapper around withTimeout for callers that already hold a TimeoutConfig object (e.g., from environment config).

      Type Parameters

      • T

        Type of the promise result

      Parameters

      Returns Promise<T>

      Promise resolving with the result or rejecting with TimeoutError

      If the operation exceeds config.timeoutMs

      If config.timeoutMs is not positive

      const config: TimeoutConfig = { timeoutMs: 5000, operationName: 'fetchMEPs' };
      const result = await withTimeoutConfig(fetchMEPs(), config);

      0.8.0