{"record":{"id":"2d6bf63436e28564","repo":"OpenBB-finance/OpenBB","slug":"error-e","errorCode":null,"errorMessage":"\n[Error] -> {e}","messagePattern":"\n\\[Error\\] -> (.+?)","errorType":"exception","errorClass":"UnauthorizedError","httpStatus":null,"severity":"error","filePath":"openbb_platform/core/openbb_core/app/static/utils/decorators.py","lineNumber":94,"sourceCode":"                        ]\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\n","sourceCodeStart":76,"sourceCodeEnd":109,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/core/openbb_core/app/static/utils/decorators.py#L76-L109","documentation":"Raised when the wrapped command raised an UnauthorizedError (typically an HTTP 401/403 from a provider API). The decorator prefixes the provider's message with '[Error] ->' and re-raises UnauthorizedError with the original traceback, preserving the specific class so callers can distinguish auth failures from other errors.","triggerScenarios":"Calling a command with provider='fmp' when the fmp_api_key is invalid, expired, or has no entitlement for the endpoint; provider returns 401/403 during the fetch step of the fetcher.","commonSituations":"Typo'd or revoked API key; free-tier key hitting a premium endpoint; key set for the wrong provider; key configured but environment variable not loaded; key quota exhausted leading to 403.","solutions":["Verify the API key is correct and active: obb.user.credentials.<provider>_api_key","Confirm the key's plan covers the requested endpoint (upgrade plan or use a different endpoint/provider)","Rotate/regenerate the key at the provider's website and update it in OpenBB settings","Switch to a provider whose credentials work: same command with provider='yfinance' where applicable"],"exampleFix":"# before\nobb.user.credentials.fmp_api_key = 'stale-key'\nres = obb.equity.price.historical('AAPL', provider='fmp')\n\n# after\nobb.user.credentials.fmp_api_key = 'valid-key'\nres = obb.equity.price.historical('AAPL', provider='fmp')","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"from openbb_core.provider.abstract.error import UnauthorizedError\n\ntry:\n    res = obb.equity.price.historical('AAPL', provider='fmp')\nexcept UnauthorizedError:\n    obb.user.credentials.fmp_api_key = fetch_fresh_key()\n    res = obb.equity.price.historical('AAPL', provider='fmp')","preventionTips":["Verify keys with a cheap provider call at application startup","Store keys in env/Hab rather than hardcoding, so rotation is one variable","Match key tier to the endpoints you call; prefer providers you have paid access to"],"tags":["openbb","auth","api-key","http-401"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}