{"record":{"id":"30274e326db78761","repo":"OpenBB-finance/OpenBB","slug":"str-e-or-fred-request-failed-type-e-name-30274e","errorCode":null,"errorMessage":"{str(e) or 'FRED request failed ({type(e).__name__}).'}","messagePattern":"\\{str\\(e\\) or 'FRED request failed \\(\\{type\\(e\\)\\.__name__\\}\\)\\.'\\}","errorType":"exception","errorClass":"OpenBBError","httpStatus":null,"severity":"error","filePath":"openbb_platform/providers/fred/openbb_fred/models/series.py","lineNumber":195,"sourceCode":"                    \"data\": data,\n                }\n            }\n\n        try:\n            results: list[dict] = []\n            for result in await asyncio.gather(\n                *[fetch_one(sid) for sid in series_ids], return_exceptions=True\n            ):\n                if isinstance(result, Exception):\n                    raise result\n                if result:\n                    results.append(result)  # type: ignore\n            return results\n        except OpenBBError:\n            raise\n        except Exception as e:\n            message = str(e) or f\"FRED request failed ({type(e).__name__}).\"\n            raise OpenBBError(message) from e\n\n    @staticmethod\n    def transform_data(\n        query: FredSeriesQueryParams, data: list[dict], **kwargs: Any\n    ) -> AnnotatedResult[list[FredSeriesData]]:\n        \"\"\"Transform data.\"\"\"\n        # pylint: disable=import-outside-toplevel\n        from pandas import DataFrame  # noqa\n        from numpy import nan\n\n        series = {_id: s.pop(\"data\", {}) for d in data for _id, s in d.items()}\n        metadata = {_id: m for d in data for _id, m in d.items()}\n        records = (\n            DataFrame(series)\n            .filter(items=query.symbol.split(\",\"), axis=1)\n            .sort_index()\n            .reset_index()\n            .rename(columns={\"index\": \"date\"})","sourceCodeStart":177,"sourceCodeEnd":213,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/fred/openbb_fred/models/series.py#L177-L213","documentation":"The generic wrapper in FredSeriesFetcher.aextract_data (openbb_fred/models/series.py:195): any exception raised while fetching the requested series (network error, JSON decode error, unexpected provider error) that is not itself an OpenBBError is re-raised as OpenBBError(str(e)), preserving the original as __cause__. Note that gather runs with return_exceptions=True and each exception is immediately re-raised, so the first failing series ID aborts the whole multi-symbol request.","triggerScenarios":"One invalid/discontinued symbol in a comma-separated symbol list (underlying error then wrapped here); connection resets/timeouts to api.stlouisfed.org; malformed JSON from a proxy; pandas/date parsing errors on malformed observations.","commonSituations":"Batch-fetching many symbols where a single bad ID kills the batch; running behind corporate proxies that alter TLS responses; intermittent network drops during large historical pulls.","solutions":["Read the wrapped message - it is the original exception's text and names the real cause.","Split multi-symbol requests into per-symbol calls so one bad ID does not abort the rest.","For network errors, retry with exponential backoff; verify reachability of api.stlouisfed.org.","Validate each symbol exists with fred_search(query=symbol) before the batch fetch."],"exampleFix":"# before - one bad symbol aborts everything\nobb.economy.fred.series(symbol='GDP,CPIAUCSL,BADID')\n\n# after - isolate failures per symbol\nfor sym in ['GDP', 'CPIAUCSL', 'BADID']:\n    try:\n        obb.economy.fred.series(symbol=sym)\n    except OpenBBError as e:\n        print(f'{sym} failed: {e}')","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"from openbb_core.app.model.abstract.error import OpenBBError\n\nresults = {}\nfor sym in symbols:  # per-symbol isolation; one bad ID no longer kills the batch\n    try:\n        results[sym] = obb.economy.fred.series(symbol=sym, **params)\n    except OpenBBError as e:\n        print(f'{sym}: {e.__cause__ or e}')  # original exception preserved via __cause__\n        continue","preventionTips":["Fetch symbols individually (or small chunks) so gather's fail-fast does not abort the batch.","Pre-validate symbol IDs with fred_search and drop unknowns before bulk fetch.","Use the __cause__ chain to diagnose the real underlying exception."],"tags":["fred","series","wrapper","network","batch"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}