{"record":{"id":"2a4813bd0049670b","repo":"srbhr/Resume-Matcher","slug":"unsupported-provider-provider-supported-supp","errorCode":null,"errorMessage":"Unsupported provider: {provider}. Supported: {SUPPORTED_PROVIDERS}","messagePattern":"Unsupported provider: (.+?)\\. Supported: (.+?)","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"apps/backend/app/routers/config.py","lineNumber":637,"sourceCode":"            detail=\"Confirmation required. Pass confirm=CLEAR_ALL_KEYS query parameter.\",\n        )\n    clear_all_api_keys()\n    invalidate_config_cache()\n    return {\"message\": \"All API keys have been cleared\"}\n\n\n@router.delete(\"/api-keys/{provider}\")\nasync def delete_api_key(provider: str) -> dict:\n    \"\"\"Delete API key for a specific provider.\n\n    Args:\n        provider: The provider name (openai, anthropic, google, openrouter, deepseek)\n\n    Returns:\n        Success message\n    \"\"\"\n    if provider not in SUPPORTED_PROVIDERS:\n        raise HTTPException(\n            status_code=400,\n            detail=f\"Unsupported provider: {provider}. Supported: {SUPPORTED_PROVIDERS}\",\n        )\n\n    delete_api_key_from_config(provider)\n    invalidate_config_cache()\n\n    return {\"message\": f\"API key for {provider} has been removed\"}\n\n\n@router.post(\"/reset\")\nasync def reset_database_endpoint(request: ResetDatabaseRequest) -> dict:\n    \"\"\"Reset the database and clear all data.\n\n    WARNING: This action is irreversible. It will:\n    1. Truncate all database tables (resumes, jobs, improvements)\n    2. Delete all uploaded files\n","sourceCodeStart":619,"sourceCodeEnd":655,"githubUrl":"https://github.com/srbhr/Resume-Matcher/blob/116f9cc3b00e1ac91734a6c2679bf41ea64a0edc/apps/backend/app/routers/config.py#L619-L655","documentation":"Raised by the delete_api_key endpoint in apps/backend/app/routers/config.py when the provider path/body value is not one of the names in SUPPORTED_PROVIDERS (openai, anthropic, google, openrouter, deepseek). The endpoint refuses to delete a config entry for an unknown provider rather than silently succeeding. It is a plain 400 client error driven by a membership check.","triggerScenarios":"Calling DELETE for an API key with a misspelled or unsupported provider (e.g. 'OpenAI' with wrong case, 'azure-openai', 'groq', or an empty string) such that `provider not in SUPPORTED_PROVIDERS`.","commonSituations":"Hardcoded provider strings in client code drifting from the backend's supported list; typos or casing mismatches; adding a new provider on the client before updating SUPPORTED_PROVIDERS on the backend.","solutions":["Check the provider string against the exact names in SUPPORTED_PROVIDERS (openai, anthropic, google, openrouter, deepseek)","Fix spelling/casing to lowercase exact match","If a legitimately new provider is needed, add it to SUPPORTED_PROVIDERS in the backend and to the delete API key path","Confirm the key actually exists under a supported provider before calling delete"],"exampleFix":"// before\ndelete('/config/api-key/open-ai')\n// after\ndelete('/config/api-key/openai')","handlingStrategy":"validation","validationCode":"const SUPPORTED = ['openai','anthropic','google','openrouter','deepseek'];\nif (!SUPPORTED.includes(provider)) throw new Error(`Unsupported provider: ${provider}`);","typeGuard":null,"tryCatchPattern":"try { await api.deleteApiKey(provider); } catch (e) { if (e.status === 400) { console.error('Pick a supported provider:', e.detail); } else throw e; }","preventionTips":["Keep a shared constant list of supported providers in client code","Always lowercase/trim provider strings before sending","Fetch supported providers from the backend config endpoint instead of hardcoding","Add UI dropdowns rather than free-text provider input"],"tags":["http","validation","bad-request","provider"],"backgroundTag":"unsupported-provider","analyzedSha":"116f9cc3b00e1ac91734a6c2679bf41ea64a0edc","analyzedAt":"2026-08-28T22:51:40.999Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}