{"record":{"id":"da9b10c75f6dd4f9","repo":"OpenBB-finance/OpenBB","slug":"e-da9b10","errorCode":null,"errorMessage":"{e}","messagePattern":"\\{e\\}","errorType":"exception","errorClass":"OpenBBError","httpStatus":null,"severity":"error","filePath":"openbb_platform/providers/imf/openbb_imf/models/maritime_chokepoint_volume.py","lineNumber":302,"sourceCode":"        import asyncio  # noqa\n        from openbb_imf.utils.port_watch_helpers import (\n            get_daily_chokepoint_data,\n            get_all_daily_chokepoint_activity_data,\n        )\n\n        chokepoints = (\n            query.chokepoint\n            if isinstance(query.chokepoint, list)\n            else query.chokepoint.split(\",\") if query.chokepoint else []\n        )\n\n        if not chokepoints:\n            try:\n                return await get_all_daily_chokepoint_activity_data(\n                    start_date=query.start_date, end_date=query.end_date\n                )\n            except Exception as e:\n                raise OpenBBError(e) from e\n\n        results: list = []\n\n        async def get_one(chokepoint_id):\n            \"\"\"Get data for a single chokepoint.\"\"\"\n            data = await get_daily_chokepoint_data(\n                chokepoint_id, query.start_date, query.end_date\n            )\n            if data:\n                results.extend(data)\n\n        # Accept both keys and values from CHOKEPOINTS_NAME_TO_ID\n        chokepoint_ids: list = []\n        for chokepoint in chokepoints:\n            if chokepoint in CHOKEPOINTS_NAME_TO_ID:\n                chokepoint_ids.append(CHOKEPOINTS_NAME_TO_ID[chokepoint])\n            elif chokepoint in CHOKEPOINTS_NAME_TO_ID.values() or chokepoint.startswith(\n                \"chokepoint\"","sourceCodeStart":284,"sourceCodeEnd":320,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/imf/openbb_imf/models/maritime_chokepoint_volume.py#L284-L320","documentation":"Catch-all in `afetch_data` of the chokepoint volume fetcher: when no chokepoint is specified, it calls `get_all_daily_chokepoint_activity_data` for the full 24-chokepoint dataset and any exception (network failure, HTTP error, parse error) is re-wrapped as OpenBBError with the original as `__cause__`. The message is whatever the inner exception str is.","triggerScenarios":"Calling maritime_chokepoint_volume without `chokepoint` while the PortWatch/ArcGIS bulk endpoint fails: timeouts, non-200 status inside the helper, TLS errors, or JSON decode failures on a truncated response.","commonSituations":"Bulk historical pulls (the no-chokepoint path downloads a lot) hitting ArcGIS throttling or a slow connection that times out; running in sandboxes with restricted egress to services9.arcgis.com or portwatch.imf.org.","solutions":["Read the wrapped cause (`e.__cause__`) for the true failure — it may be a timeout, 429, or DNS error.","Retry, possibly with a narrower start_date/end_date to shrink the bulk download.","Specify explicit chokepoints to switch to the per-chokepoint endpoint, which is lighter than the bulk fetch.","Verify network egress to the PortWatch/ArcGIS hosts."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    data = await obb.economy.imf.maritime_chokepoint_volume(start_date=s, end_date=e)\nexcept OpenBBError as e:\n    cause = e.__cause__ or e\n    if is_transient(cause):  # timeout / 429 / connection reset\n        await asyncio.sleep(backoff())\n        data = await obb.economy.imf.maritime_chokepoint_volume(start_date=s, end_date=e)\n    else:\n        raise","preventionTips":["Narrow start_date/end_date for bulk pulls to reduce timeout risk","Wrap bulk endpoints with retry + backoff in production jobs"],"tags":["imf","portwatch","network","wrapper-exception"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}