koala73/worldmonitor · warning · Error

no results

Error message

no results

What it means

Thrown inside the searchGoogleFlights cache producer when the relay returned 2xx but json.flights is not an array — the body's error field is re-thrown if present, otherwise 'no results'. The outer catch converts it to {flights: [], degraded: true, error: 'no results'}; the identical string is also returned (without throwing) when cachedFetchJson yields null.

Source

Thrown at server/worldmonitor/aviation/v1/search-google-flights.ts:64

  }

  // Cache key uses a sorted-airlines axis so input order doesn't fragment cache hits;
  // the relay still receives airlines in the caller's order via `params`.
  const sortedAirlinesKey = [...airlines].sort().join(',');
  const cacheKey = `aviation:gf:${origin}:${destination}:${departureDate}:${req.returnDate ?? ''}:${req.cabinClass ?? ''}:${req.maxStops ?? ''}:${req.departureWindow ?? ''}:${req.sortBy ?? ''}:${passengers}:${sortedAirlinesKey}:v1`;

  try {
    const data = await cachedFetchJson<{ flights: unknown[] }>(
      cacheKey,
      CACHE_TTL,
      async () => {
        const resp = await fetch(`${relayBaseUrl}/google-flights/search?${params}`, {
          headers: getRelayHeaders(),
          signal: AbortSignal.timeout(20_000),
        });
        if (!resp.ok) throw new Error(`relay returned ${resp.status}`);
        const json = (await resp.json()) as { flights?: unknown[]; error?: string };
        if (!Array.isArray(json.flights)) throw new Error(json.error ?? 'no results');
        return { flights: json.flights };
      },
    );

    if (!data) {
      return { flights: [], degraded: true, error: 'no results' };
    }

    return {
      flights: data.flights as SearchGoogleFlightsResponse['flights'],
      degraded: false,
      error: '',
    };
  } catch (err) {
    return { flights: [], degraded: true, error: err instanceof Error ? err.message : 'search failed' };
  }
}

View on GitHub (pinned to 9361220cc0)

Solutions

  1. Sanity-check the query (valid IATA pair, future departure date, supported cabin/stops values)
  2. Treat degraded=true + 'no results' as retryable upstream unavailability, not a definitive empty set
  3. Check relay logs if valid queries consistently degrade — scraper health is the usual culprit
Defensive patterns

Strategy: fallback

Validate before calling

// cheap client-side sanity before the call
if (!origin || !destination || !departureDate) return skip('missing flight search params');

Type guard

function isNoResultsFlights(r: { degraded: boolean; error: string }): boolean {
  return r.degraded && r.error === 'no results';
}

Try / catch

const res = await searchGoogleFlights(req);
if (isNoResultsFlights(res)) return offerRetry(); // scrape may have failed — not a definitive answer

Prevention

When it happens

Trigger: Relay 200 with {error: ...} because the Google Flights scrape failed (anti-bot, captcha); relay schema drift where flights is missing or an object; legitimately unavailable route/date combination reported via error.

Common situations: Scraper blocked by upstream anti-bot measures; cabin class / passenger combinations the relay cannot serve; relay response-shape change after an update.

Related errors


AI-assisted analysis of koala73/worldmonitor@9361220cc0 (2026-08-21). Data as JSON: /api/errors/2a575580a06bd298. Report an issue: GitHub.