{"record":{"id":"b05decc7478fd989","repo":"chatboxai/chatbox","slug":"unsupported-search-provider-provider","errorCode":null,"errorMessage":"Unsupported search provider: ${provider}","messagePattern":"Unsupported search provider: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/renderer/packages/web-search/index.ts","lineNumber":67,"sourceCode":"      if (!settings.webSearch.bochaApiKey) {\n        throw ChatboxAIAPIError.fromCodeName('bocha_api_key_required', 'bocha_api_key_required')\n      }\n      selectedProviders.push(new BochaSearch(settings.webSearch.bochaApiKey))\n      break\n    case 'querit':\n      if (!settings.webSearch.queritApiKey) {\n        throw ChatboxAIAPIError.fromCodeName('querit_api_key_required', 'querit_api_key_required')\n      }\n      selectedProviders.push(\n        new QueritSearch(\n          settings.webSearch.queritApiKey,\n          settings.webSearch.queritMaxResults,\n          settings.webSearch.queritTimeRange\n        )\n      )\n      break\n    default:\n      throw new Error(`Unsupported search provider: ${provider}`)\n  }\n\n  return selectedProviders\n}\n\nasync function _searchRelatedResults(query: string, signal?: AbortSignal) {\n  const providers = getSearchProviders()\n  const results = await Promise.all(\n    providers.map(async (provider) => {\n      try {\n        const result = await provider.search(query, signal)\n        console.debug(`web search result for \"${query}\":`, result.items)\n        return result\n      } catch (err) {\n        console.error(err)\n        return { items: [] }\n      }\n    })","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/chatboxai/chatbox/blob/81571269addb6bafb589a920b2883f1e1e084fd1/src/renderer/packages/web-search/index.ts#L49-L85","documentation":"Thrown by getSearchProviders() in the web-search module when the requested provider value does not match any case in the switch (chatbox/bing/tavily/bocha/querit). It is the default-case guard marking an unsupported/unconfigured search provider as a config error.","triggerScenarios":"settings.webSearch.provider (or whichever variable feeds the switch) holds a value outside the supported set, e.g. a typo, an empty string, or a provider constant that was renamed/removed. The `default:` branch throws.","commonSituations":"Stale settings from an older app version referencing a removed provider; manual settings edit with a wrong provider name; a new provider was added to docs but not yet to this switch; settings migration left an undefined provider.","solutions":["Set the web search provider to one of: chatbox, bing, tavily, bocha, querit (per the current switch cases).","If the provider requires an API key (tavily/bocha/querit), set the corresponding key first.","If a provider was renamed, update settings to the new name via the UI."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const SUPPORTED_PROVIDERS = ['chatbox', 'bing', 'tavily', 'bocha', 'querit'] as const\nfunction isSupportedProvider(p: string): p is typeof SUPPORTED_PROVIDERS[number] {\n  return (SUPPORTED_PROVIDERS as readonly string[]).includes(p)\n}\nif (!isSupportedProvider(settings.webSearch.provider)) {\n  // reset to a supported provider; do not call getSearchProviders\n}","typeGuard":"function isSupportedProvider(p: unknown): p is 'chatbox' | 'bing' | 'tavily' | 'bocha' | 'querit' {\n  return typeof p === 'string' && ['chatbox', 'bing', 'tavily', 'bocha', 'querit'].includes(p)\n}","tryCatchPattern":"try {\n  const providers = getSearchProviders()\n} catch (e) {\n  if (e instanceof Error && /Unsupported search provider/.test(e.message)) {\n    // reset settings.webSearch.provider to a default and retry\n  }\n}","preventionTips":["Restrict the provider picker UI to the supported set.","Run a settings migration that maps removed/renamed providers to defaults.","Validate provider + required API key together before enabling search."],"tags":["web-search","config","validation","provider"],"backgroundTag":null,"analyzedSha":"81571269addb6bafb589a920b2883f1e1e084fd1","analyzedAt":"2026-08-12T21:51:44.981Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}