{"record":{"id":"edeb47aa20feec52","repo":"OpenBB-finance/OpenBB","slug":"invalid-country-v-available-countries-are","errorCode":null,"errorMessage":"Invalid country: {v}. Available countries are: {', '.join(CPI_COUNTRIES)}","messagePattern":"Invalid country: (.+?)\\. Available countries are: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"openbb_platform/providers/fred/openbb_fred/models/consumer_price_index.py","lineNumber":40,"sourceCode":"    __json_schema_extra__ = {\n        \"country\": {\n            \"multiple_items_allowed\": True,\n            \"choices\": CPI_COUNTRIES,\n        },\n        \"transform\": {\n            \"choices\": [\"index\", \"yoy\", \"period\"],\n        },\n    }\n\n    @field_validator(\"country\", mode=\"before\", check_fields=False)\n    @classmethod\n    def validate_country(cls, c: str):\n        \"\"\"Validate country.\"\"\"\n        result: list = []\n        values = c.replace(\" \", \"_\").split(\",\")\n        for v in values:\n            if v.lower() not in CPI_COUNTRIES:\n                raise ValueError(\n                    f\"Invalid country: {v}. Available countries are: {', '.join(CPI_COUNTRIES)}\"\n                )\n            result.append(v.lower())\n        return \",\".join(result)\n\n    @field_validator(\"transform\", mode=\"before\", check_fields=False)\n    @classmethod\n    def validate_transform(cls, t: str):\n        \"\"\"Validate transform.\"\"\"\n        valid_transforms = [\"index\", \"yoy\", \"period\"]\n        if t.lower() not in valid_transforms:\n            raise ValueError(\n                f\"Invalid transform: {t}. Available transforms are: {', '.join(valid_transforms)}\"\n            )\n        return t.lower()\n\n\nclass FREDConsumerPriceIndexData(ConsumerPriceIndexData):","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/fred/openbb_fred/models/consumer_price_index.py#L22-L58","documentation":"Error \"Invalid country: {v}. Available countries are: {', '.join(CPI_COUNTRIES)}\" thrown in OpenBB-finance/OpenBB.","triggerScenarios":"Thrown at openbb_platform/providers/fred/openbb_fred/models/consumer_price_index.py:40 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Choose a country from the listed available CPI countries.","Pass the country exactly as listed (correct spelling and case)."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}