{"record":{"id":"16a8f78d7406507f","repo":"OpenBB-finance/OpenBB","slug":"there-was-an-error-with-the-request-and-was-return","errorCode":null,"errorMessage":"There was an error with the request and was returned empty.","messagePattern":"There was an error with the request and was returned empty\\.","errorType":"exception","errorClass":"EmptyDataError","httpStatus":null,"severity":"warning","filePath":"openbb_platform/providers/federal_reserve/openbb_federal_reserve/utils/ny_fed_api.py","lineNumber":413,"sourceCode":"\n        return release_log\n\n    async def get_summary(self) -> list[dict]:\n        \"\"\"Return historical weekly summary by holding type.\n\n        Returns\n        -------\n        List[Dict]: Historical weekly summary by holding type.\n\n        Example\n        -------\n        summary = await SomaHoldings().get_summary()\n        \"\"\"\n        url = _get_endpoints()[\"soma_holdings\"][\"summary\"]\n        response = await fetch_data(url)\n        summary = response.get(\"soma\", {}).get(\"summary\", [])\n        if not summary:\n            raise EmptyDataError(\n                \"There was an error with the request and was returned empty.\"\n            )\n\n        return summary\n\n    async def get_agency_holdings(\n        self,\n        as_of: str | None = None,\n        cusip: str | None = None,\n        holding_type: str | None = None,\n        wam: bool = False,\n    ) -> list[dict]:\n        \"\"\"Get the latest agency holdings, or as of a single date. Data is updated weekly.\n\n        Parameters\n        ----------\n        as_of: Optional[str]\n            The as-of date to get data for. Defaults to the latest.","sourceCodeStart":395,"sourceCodeEnd":431,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/federal_reserve/openbb_federal_reserve/utils/ny_fed_api.py#L395-L431","documentation":"EmptyDataError from SomaHoldings.get_summary: the SOMA weekly summary endpoint responded but soma.summary was empty. Unlike 374/375 this is EmptyDataError — OpenBB treats it as 'no results for the query' even though the wording says 'error with the request'.","triggerScenarios":"Calling get_summary() (weekly holdings summary by type) when the NY Fed returns an empty summary array — service hiccup, schema change, or endpoint temporarily unpublished.","commonSituations":"Long-running dashboards polling SOMA summary; upstream schema renames of the 'summary' key; intermittent empty responses.","solutions":["Retry once after a short backoff — many empty responses are transient.","Verify the endpoint payload manually; if the key was renamed, update the provider.","Catch EmptyDataError and fall back to your last cached summary."],"exampleFix":"try:\n    summary = await SomaHoldings().get_summary()\nexcept EmptyDataError:\n    summary = load_cached_summary()  # degrade gracefully\n    if summary is None:\n        raise","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"from openbb_core.provider.standard_errors import EmptyDataError\ntry:\n    summary = await SomaHoldings().get_summary()\nexcept EmptyDataError:\n    summary = cache.get('soma_summary')\n    if summary is None:\n        raise","preventionTips":["Persist the last good weekly summary for fallback","Retry once before falling back — many empties are transient"],"tags":["openbb","ny-fed","soma","empty-data"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}