{"record":{"id":"52a6fed4fd55d8de","repo":"OpenBB-finance/OpenBB","slug":"error-error-str","errorCode":null,"errorMessage":"\n[Error] -> {error_str}","messagePattern":"\n\\[Error\\] -> (.+?)","errorType":"exception","errorClass":"OpenBBError","httpStatus":null,"severity":"error","filePath":"openbb_platform/core/openbb_core/app/static/utils/decorators.py","lineNumber":90,"sourceCode":"                                \"standard_params\",\n                                \"extra_params\",\n                                \"provider_choices\",\n                            )\n                        ]\n                    )\n                    msg = err.get(\"msg\", \"\")\n                    _input = (\n                        \"...\"\n                        if msg == \"Missing required argument\"\n                        else err.get(\"input\", \"\")\n                    )\n                    prefix = f\"[Data Model] {e.title}\\n\" if \"Data\" in e.title else \"\"\n                    error_list.append(\n                        f\"{prefix}[Arg] {loc} -> input: {_input} -> {msg}\"\n                    )\n                error_list.insert(0, validation_error)\n                error_str = \"\\n\".join(error_list)\n                raise OpenBBError(f\"\\n[Error] -> {error_str}\").with_traceback(\n                    tb\n                ) from None\n            if isinstance(e, UnauthorizedError):\n                raise UnauthorizedError(f\"\\n[Error] -> {e}\").with_traceback(\n                    tb\n                ) from None\n            if isinstance(e, EmptyDataError):\n                raise EmptyDataError(f\"\\n[Empty] -> {e}\").with_traceback(tb) from None\n            if isinstance(e, OpenBBError):\n                raise OpenBBError(f\"\\n[Error] -> {e}\").with_traceback(tb) from None\n            if isinstance(e, Exception):\n                raise OpenBBError(\n                    f\"\\n[Unexpected Error] -> {e.__class__.__name__} -> {e}\"\n                ).with_traceback(tb) from None\n\n        return None\n\n    return wrapper","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/core/openbb_core/app/static/utils/decorators.py#L72-L108","documentation":"This is the catch-all of OpenBB's exception decorator for a Pydantic ValidationError raised while validating command parameters or Data models. It re-formats each invalid argument as '[Arg] <location> -> input: <value> -> <message>' lines under a '[Data Model]' or '[Error]' header and re-raises as OpenBBError with the original traceback attached.","triggerScenarios":"Calling any @exception_handler-decorated command with a bad parameter value: obb.equity.price.historical(symbol=123, provider='fmp') where symbol must be a str, or a provider fetcher returning rows that fail the standard model's field validation (e.g. date='not-a-date').","commonSituations":"Passing an int/None where a string is required; passing a provider-specific enum choice not in QueryParams.choices; provider API responses whose fields violate the Data model after a schema change; upstream API format changes breaking date/float coercion.","solutions":["Read the '[Arg] <field>' lines in the message to find which parameter failed and correct its value/type","Check the command's parameter schema (obb.coverage / .model_validate) or docs for allowed types and choices","If the error comes from a Data model (prefix '[Data Model] <Name>'), the provider returned malformed data - pin/upgrade the provider package or report the issue","Validate inputs with the command's Params model before calling"],"exampleFix":"# before\nres = obb.equity.price.historical(symbol=12345, provider='fmp')\n\n# after\nres = obb.equity.price.historical(symbol='12345', provider='fmp')","handlingStrategy":"validation","validationCode":"from openbb import obb\n\nparams = obb.equity.price.historical.__doc__  # inspect signature\n# programmatic check via schema:\ncmd = 'equity.price.historical'\nschema = obb.coverage.commands  # verify parameter types/choices before calling\nassert schema.get(cmd), 'unknown command'","typeGuard":"def valid_symbol(s) -> bool:\n    return isinstance(s, str) and s.isalpha() and 1 <= len(s) <= 12","tryCatchPattern":"from openbb_core.app.model.abstract.error import OpenBBError\n\ntry:\n    res = obb.equity.price.historical('AAPL', provider='fmp')\nexcept OpenBBError as e:\n    msg = str(e)\n    if '[Arg]' in msg:\n        # parse failing arg lines and fix inputs, then retry or log\n        bad = [ln for ln in msg.splitlines() if '[Arg]' in ln]\n        raise ValueError(f'bad request params: {bad}') from None\n    raise","preventionTips":["Coerce types before calling (str(symbol), ISO dates for start_date/end_date)","Check enum choices via the command schema instead of guessing values","Keep provider packages updated so Data models match API responses"],"tags":["openbb","validation","pydantic","parameters"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}