jackwener/OpenCLI · warning · EmptyResultError
wttr.in returned no current conditions for "${location}".
Error message
wttr.in returned no current conditions for "${location}". What it means
EmptyResultError thrown by `opencli wttr current` when the wttr.in JSON response has no current_condition array or it is empty. The command requires at least one current-conditions object to build its output row, so it treats the absence as an empty result naming the requested location.
Source
Thrown at clis/wttr/current.js:37
name: 'location',
positional: true,
required: true,
help: 'City name, "lat,lon", airport ICAO code, or "@domain"',
},
],
columns: [
'location', 'region', 'country', 'latitude', 'longitude',
'observedAt', 'tempC', 'tempF', 'feelsLikeC', 'feelsLikeF',
'description', 'humidity', 'cloudCover', 'pressure',
'precipMm', 'visibilityKm', 'uvIndex',
'windKmph', 'windDirection', 'windDirectionDegree',
],
func: async (args) => {
const location = requireString(args.location, 'location');
const body = await wttrFetch(location, 'wttr current');
const cur = Array.isArray(body?.current_condition) ? body.current_condition[0] : null;
if (!cur) {
throw new EmptyResultError('wttr current', `wttr.in returned no current conditions for "${location}".`);
}
const area = Array.isArray(body?.nearest_area) ? body.nearest_area[0] : null;
return [{
location: pickWeatherDesc(area?.areaName) || location,
region: pickWeatherDesc(area?.region),
country: pickWeatherDesc(area?.country),
latitude: area?.latitude ?? null,
longitude: area?.longitude ?? null,
observedAt: cur.localObsDateTime ?? null,
tempC: cur.temp_C != null ? Number(cur.temp_C) : null,
tempF: cur.temp_F != null ? Number(cur.temp_F) : null,
feelsLikeC: cur.FeelsLikeC != null ? Number(cur.FeelsLikeC) : null,
feelsLikeF: cur.FeelsLikeF != null ? Number(cur.FeelsLikeF) : null,
description: pickWeatherDesc(cur.weatherDesc),
humidity: cur.humidity != null ? Number(cur.humidity) : null,
cloudCover: cur.cloudcover != null ? Number(cur.cloudcover) : null,
pressure: cur.pressure != null ? Number(cur.pressure) : null,
precipMm: cur.precipMM != null ? Number(cur.precipMM) : null,View on GitHub (pinned to 49907e53dc)
Solutions
- Retry — wttr.in rate limits are per-minute and often transient
- Use a more standard location format: "City" or "City,Country" (e.g. "Paris,France") or an airport code
- Use fewer calls or cache results to stay under wttr.in's rate limit
- Fall back to a nearby larger city the service definitely resolves
Example fix
// before opencli wttr current "some tiny village" // after opencli wttr current "Paris,France"
Defensive patterns
Strategy: fallback
Validate before calling
if (!location || !location.trim()) throw new Error('location is required'); Type guard
function hasCurrentCondition(body) {
return Array.isArray(body?.current_condition) && body.current_condition.length > 0 && !!body.current_condition[0];
} Try / catch
try {
const rows = await run('wttr current', [location]);
} catch (e) {
if (/no current conditions/.test(e.message)) {
return run('wttr current', ['London']);
}
throw e;
} Prevention
- Retry after a short delay — wttr.in rate limits aggressively
- Use canonical formats: "City,Country" or airport codes
- Cache results to reduce request volume
- Fall back to a nearby major city
When it happens
Trigger: `opencli wttr current <location>` where wttrFetch's parsed body lacks body.current_condition[0] — wttr.in returning an error page/empty body for an unresolvable location, rate limiting (wttr.in heavily limits anonymous requests), or upstream service degradation.
Common situations: Unrecognized or ambiguous location strings, wttr.in rate limits (very common with shared/VPN IPs), wttr.in outages, typos in the location name.
Related errors
- No prices returned for train_no=${trainNo} ${fromStation.nam
- No 12306 stations match "${keyword}"
- No trains found from ${fromStation.name} to ${toStation.name
- 1point3acres thread
- 1point3acres user
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/a718ef972dc6f8cd.
Report an issue: GitHub.