{"record":{"id":"a718ef972dc6f8cd","repo":"jackwener/OpenCLI","slug":"wttr-in-returned-no-current-conditions-for-loca","errorCode":null,"errorMessage":"wttr.in returned no current conditions for \"${location}\".","messagePattern":"wttr\\.in returned no current conditions for \"(.+?)\"\\.","errorType":"error_code","errorClass":"EmptyResultError","httpStatus":null,"severity":"warning","filePath":"clis/wttr/current.js","lineNumber":37,"sourceCode":"            name: 'location',\n            positional: true,\n            required: true,\n            help: 'City name, \"lat,lon\", airport ICAO code, or \"@domain\"',\n        },\n    ],\n    columns: [\n        'location', 'region', 'country', 'latitude', 'longitude',\n        'observedAt', 'tempC', 'tempF', 'feelsLikeC', 'feelsLikeF',\n        'description', 'humidity', 'cloudCover', 'pressure',\n        'precipMm', 'visibilityKm', 'uvIndex',\n        'windKmph', 'windDirection', 'windDirectionDegree',\n    ],\n    func: async (args) => {\n        const location = requireString(args.location, 'location');\n        const body = await wttrFetch(location, 'wttr current');\n        const cur = Array.isArray(body?.current_condition) ? body.current_condition[0] : null;\n        if (!cur) {\n            throw new EmptyResultError('wttr current', `wttr.in returned no current conditions for \"${location}\".`);\n        }\n        const area = Array.isArray(body?.nearest_area) ? body.nearest_area[0] : null;\n        return [{\n            location: pickWeatherDesc(area?.areaName) || location,\n            region: pickWeatherDesc(area?.region),\n            country: pickWeatherDesc(area?.country),\n            latitude: area?.latitude ?? null,\n            longitude: area?.longitude ?? null,\n            observedAt: cur.localObsDateTime ?? null,\n            tempC: cur.temp_C != null ? Number(cur.temp_C) : null,\n            tempF: cur.temp_F != null ? Number(cur.temp_F) : null,\n            feelsLikeC: cur.FeelsLikeC != null ? Number(cur.FeelsLikeC) : null,\n            feelsLikeF: cur.FeelsLikeF != null ? Number(cur.FeelsLikeF) : null,\n            description: pickWeatherDesc(cur.weatherDesc),\n            humidity: cur.humidity != null ? Number(cur.humidity) : null,\n            cloudCover: cur.cloudcover != null ? Number(cur.cloudcover) : null,\n            pressure: cur.pressure != null ? Number(cur.pressure) : null,\n            precipMm: cur.precipMM != null ? Number(cur.precipMM) : null,","sourceCodeStart":19,"sourceCodeEnd":55,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/wttr/current.js#L19-L55","documentation":"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.","triggerScenarios":"`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.","commonSituations":"Unrecognized or ambiguous location strings, wttr.in rate limits (very common with shared/VPN IPs), wttr.in outages, typos in the location name.","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"],"exampleFix":"// before\nopencli wttr current \"some tiny village\"\n// after\nopencli wttr current \"Paris,France\"","handlingStrategy":"fallback","validationCode":"if (!location || !location.trim()) throw new Error('location is required');","typeGuard":"function hasCurrentCondition(body) {\n  return Array.isArray(body?.current_condition) && body.current_condition.length > 0 && !!body.current_condition[0];\n}","tryCatchPattern":"try {\n  const rows = await run('wttr current', [location]);\n} catch (e) {\n  if (/no current conditions/.test(e.message)) {\n    return run('wttr current', ['London']);\n  }\n  throw e;\n}","preventionTips":["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"],"tags":["empty-result","weather","wttr"],"backgroundTag":"empty-result","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}