OpenBB-finance/OpenBB · error · OpenBBError

{e}

Error message

{e}

What it means

OpenBBError wrapping any exception raised while fetching forward P/E data for a single symbol inside get_one(). The amake_request call (or its response_callback) threw something other than a pass-through OpenBBError, and this handler re-raises it as OpenBBError with the original as cause, so per-symbol network/parse failures are not silently dropped when symbols are requested individually.

Source

Thrown at openbb_platform/providers/intrinio/openbb_intrinio/models/forward_pe_estimates.py:94

        import asyncio  # noqa
        from openbb_core.provider.utils.errors import EmptyDataError, UnauthorizedError
        from openbb_core.provider.utils.helpers import amake_request
        from openbb_intrinio.utils.helpers import response_callback

        api_key = credentials.get("intrinio_api_key") if credentials else ""
        BASE_URL = "https://api-v2.intrinio.com/zacks/forward_pe"
        symbols = query.symbol.split(",") if query.symbol else None
        results: list[dict] = []

        async def get_one(symbol):
            """Get the data for one symbol."""
            url = f"{BASE_URL}/{symbol}?api_key={api_key}"
            try:
                data = await amake_request(
                    url, response_callback=response_callback, **kwargs
                )
            except Exception as e:
                raise OpenBBError(e) from e

            if data:
                results.append(data)  # type: ignore

        if symbols:
            try:
                gather_results = await asyncio.gather(
                    *[get_one(symbol) for symbol in symbols], return_exceptions=True
                )

                for result in gather_results:
                    if isinstance(result, UnauthorizedError):
                        raise result
                    if isinstance(result, OpenBBError):
                        raise result

                if not results:
                    raise EmptyDataError(

View on GitHub (pinned to 3e071fcc2c)

Solutions

  1. Inspect the wrapped exception text (it embeds the underlying error) to identify network vs parse failure.
  2. Retry the single failing symbol after a short delay for transient network errors.
  3. Verify the symbol with a direct curl to the same URL including your api_key.
  4. Split large symbol batches to isolate the failing ticker.
Defensive patterns

Strategy: retry

Validate before calling

import socket
socket.gethostbyname('api-v2.intrinio.com')  # fail fast on DNS problems before the call

Try / catch

from openbb_core.provider.exceptions import OpenBBError
import time
for attempt in range(3):
    try:
        res = obb.equity.estimates.forward_pe(symbol=sym, provider='intrinio')
        break
    except OpenBBError as e:
        if attempt == 2 or 'empty' in str(e).lower():
            raise
        time.sleep(2 ** attempt)

Prevention

When it happens

Trigger: equity/estimates/forward_pe with provider=intrinio where amake_request for 'https://api-v2.intrinio.com/zacks/forward_pe/{symbol}' raises a network timeout, connection reset, JSON decode error, or unexpected status; also raised from the per-symbol path when the callback itself throws.

Common situations: Transient network failures or DNS issues; Intrinio returning non-JSON (HTML error page) for a bad symbol; proxies/firewalls intercepting the request; one bad ticker in a comma-separated batch.

Related errors


AI-assisted analysis of OpenBB-finance/OpenBB@3e071fcc2c (2026-08-14). Data as JSON: /api/errors/37715836735570cf. Report an issue: GitHub.