diegosouzapw/OmniRoute · error · SearchError

Search failed

Error message

Search failed

What it means

Error "Search failed" thrown in diegosouzapw/OmniRoute.

Source

Thrown at src/app/api/v1/search/route.ts:376

        searchType: body.search_type,
        country: body.country,
        language: body.language,
        timeRange: body.time_range,
        offset: body.offset,
        domainFilter: buildDomainFilter(body.filters),
        contentOptions: body.content,
        strictFilters: body.strict_filters,
        providerOptions: body.provider_options,
        credentials,
        alternateProvider: alternateProviderId,
        alternateCredentials,
        log,
        connectionId: credentials?.connectionId || undefined,
        apiKeyId: policy.apiKeyInfo?.id || undefined,
      });

      if (!result.success) {
        throw new SearchError(result.error || "Search failed", result.status || 502);
      }

      return result.data!;
    });

    // Record cost for budget tracking (skip cache hits — no provider cost)
    if (!cached && policy.apiKeyInfo?.id && searchResult.usage?.search_cost_usd > 0) {
      try {
        recordCost(policy.apiKeyInfo.id, searchResult.usage.search_cost_usd);
      } catch (e: any) {
        log.warn("SEARCH", `Cost recording failed: ${e?.message}`);
      }
    }

    const response = {
      id: `search-${crypto.randomUUID()}`,
      ...searchResult,
      cached,

View on GitHub (pinned to a179ffed5b)

When it happens

Trigger: Thrown at src/app/api/v1/search/route.ts:376 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25). Data as JSON: /api/errors/c2c23889e29a06c1. Report an issue: GitHub.