{"record":{"id":"df12a4a544c02ad2","repo":"OpenBB-finance/OpenBB","slug":"messages","errorCode":null,"errorMessage":"{messages}","messagePattern":"\\{messages\\}","errorType":"exception","errorClass":"OpenBBError","httpStatus":null,"severity":"error","filePath":"openbb_platform/providers/intrinio/openbb_intrinio/models/etf_search.py","lineNumber":107,"sourceCode":"\n        api_key = credentials.get(\"intrinio_api_key\") if credentials else \"\"\n        BASE = \"https://api-v2.intrinio.com/etfs\"\n        if query.exchange is not None:\n            url = f\"{BASE}?exchange={query.exchange.upper()}&page_size=10000&api_key={api_key}\"\n        elif query.query:\n            url = f\"{BASE}/search?query={query.query}&page_size=10000&api_key={api_key}\"\n        else:\n            url = f\"{BASE}?page_size=10000&api_key={api_key}\"\n\n        data: list = []\n\n        async def response_callback(response: ClientResponse, session: ClientSession):\n            \"\"\"Async response callback.\"\"\"\n            results = await response.json()\n\n            if results.get(\"messages\"):  # type: ignore\n                messages = results.get(\"messages\")  # type: ignore\n                raise OpenBBError(str(messages))\n\n            if results.get(\"etfs\") and len(results.get(\"etfs\")) > 0:  # type: ignore\n                data.extend(results.get(\"etfs\"))  # type: ignore\n                while results.get(\"next_page\"):  # type: ignore\n                    next_page = results[\"next_page\"]  # type: ignore\n                    next_url = f\"{url}&next_page={next_page}\"\n                    results = await amake_request(next_url, session=session, **kwargs)\n                    if \"etfs\" in results and len(results.get(\"etfs\")) > 0:  # type: ignore\n                        data.extend(results.get(\"etfs\"))  # type: ignore\n            return data\n\n        return await amake_request(url, response_callback=response_callback, **kwargs)  # type: ignore\n\n    @staticmethod\n    def transform_data(\n        query: IntrinioEtfSearchQueryParams,\n        data: list[dict],\n        **kwargs: Any,","sourceCodeStart":89,"sourceCodeEnd":125,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/intrinio/openbb_intrinio/models/etf_search.py#L89-L125","documentation":"OpenBBError raised in the IntrinioEtfSearchFetcher response callback when the /etfs/search (or /etfs) response contains a non-empty 'messages' key. Intrinio uses 'messages' for advisory/error notices, and the fetcher stringifies the entire list and re-raises it, losing structure but preserving the text.","triggerScenarios":"Any ETF search request where Intrinio attaches messages: invalid API key phrased as a message, restricted endpoint access, or malformed query parameters. Trigger is results.get('messages') being truthy on the first page of the response.","commonSituations":"Missing/expired intrinio_api_key on first use; free-tier key hitting the ETF search product; query strings with characters the API rejects (unencoded special characters in query.query).","solutions":["Read the str(messages) content — it is Intrinio's own notice and names the problem","If it mentions your key/subscription, set obb.account.credentials.intrinio_api_key correctly or upgrade the plan","Sanitize the query parameter (strip/encode special characters) before sending"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"from urllib.parse import quote\n\ndef clean_search_query(q: str) -> str:\n    return quote(q.strip()) if q and q.strip() else \"\"","typeGuard":"from openbb_core.provider.abstract.error import OpenBBError\n\ndef is_intrinio_messages_error(err: BaseException) -> bool:\n    return isinstance(err, OpenBBError) and (str(err).startswith(\"[\") or str(err).startswith(\"(\"))","tryCatchPattern":"from openbb_core.provider.abstract.error import OpenBBError\n\ntry:\n    res = await obb.etf.search(provider=\"intrinio\", query=q)\nexcept OpenBBError as e:\n    if \"api key\" in str(e).lower():\n        raise RuntimeError(\"fix intrinio_api_key\") from e\n    log.warning(\"etf search rejected query %r: %s\", q, e)\n    res = None","preventionTips":["URL-encode/sanitize the query parameter","Check the key before searching; messages often carry auth notices","Treat the stringified list in the message as Intrinio's advisory text"],"tags":["etf","search","intrinio","api-error","messages"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}