{"record":{"id":"9cd72f94bf418aaa","repo":"MagicMirrorOrg/MagicMirror","slug":"unknown-weather-endpoint-this-config-weatherend","errorCode":null,"errorMessage":"Unknown weather endpoint: ${this.config.weatherEndpoint}","messagePattern":"Unknown weather endpoint: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"defaultmodules/weather/providers/openweathermap.js","lineNumber":134,"sourceCode":"\t\t\t\t\t\tweatherData = onecallData.days;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"hourly\":\n\t\t\t\t\t\tweatherData = onecallData.hours;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tLog.error(`[openweathermap] Unknown type: ${this.config.type}`);\n\t\t\t\t\t\tthrow new Error(`Unknown weather type: ${this.config.type}`);\n\t\t\t\t}\n\t\t\t} else if (this.config.weatherEndpoint === \"/weather\") {\n\t\t\t\t// Current weather endpoint (API v2.5)\n\t\t\t\tweatherData = this.#generateWeatherObjectFromCurrentWeather(data);\n\t\t\t} else if (this.config.weatherEndpoint === \"/forecast\") {\n\t\t\t\t// 3-hourly forecast endpoint (API v2.5)\n\t\t\t\tweatherData = this.config.type === \"hourly\"\n\t\t\t\t\t? this.#generateHourlyWeatherObjectsFromForecast(data)\n\t\t\t\t\t: this.#generateDailyWeatherObjectsFromForecast(data);\n\t\t\t} else {\n\t\t\t\tthrow new Error(`Unknown weather endpoint: ${this.config.weatherEndpoint}`);\n\t\t\t}\n\n\t\t\tif (weatherData && this.onDataCallback) {\n\t\t\t\tthis.onDataCallback(weatherData);\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tLog.error(\"[openweathermap] Error processing weather data:\", error);\n\t\t\tif (this.onErrorCallback) {\n\t\t\t\tthis.onErrorCallback({\n\t\t\t\t\tmessage: error.message,\n\t\t\t\t\ttranslationKey: \"MODULE_ERROR_UNSPECIFIED\"\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\t#generateWeatherObjectFromCurrentWeather (data) {\n\t\tconst timezoneOffsetMinutes = (data.timezone ?? 0) / 60;","sourceCodeStart":116,"sourceCodeEnd":152,"githubUrl":"https://github.com/MagicMirrorOrg/MagicMirror/blob/4b4a59534f7da01e4030e46029fe9dd649a7675e/defaultmodules/weather/providers/openweathermap.js#L116-L152","documentation":"#handleResponse dispatches on this.config.weatherEndpoint: only '/onecall', '/weather' and '/forecast' are supported; anything else throws 'Unknown weather endpoint'. It catches stale or invalid endpoint configuration before the data is used.","triggerScenarios":"config.weatherEndpoint set to '/one', '', '/forecast/hourly', a full URL, or a removed/renamed endpoint (e.g. old '/daily').","commonSituations":"Upgrading from an older module version where endpoint names differed; typos in the endpoint string; accidentally pasting an absolute URL into the endpoint config.","solutions":["Set weatherEndpoint to one of '/onecall', '/weather' or '/forecast'","If you intended One Call 3.0, confirm the module version supports that endpoint string","Remove any absolute URLs from weatherEndpoint — it expects a path only"],"exampleFix":"// before\nconfig = { weatherEndpoint: \"/forecast16\", ... }\n// after\nconfig = { weatherEndpoint: \"/forecast\", ... }","handlingStrategy":"validation","validationCode":"const OWM_ENDPOINTS = [\"/onecall\", \"/weather\", \"/forecast\"];\nif (!OWM_ENDPOINTS.includes(config.weatherEndpoint)) throw new Error(`weatherEndpoint must be one of ${OWM_ENDPOINTS.join(\" | \")}`);","typeGuard":"const isOwmEndpoint = (e) => [\"/onecall\", \"/weather\", \"/forecast\"].includes(e);","tryCatchPattern":"try {\n  provider.initialize(config);\n} catch (err) {\n  if (err.message.startsWith(\"Unknown weather endpoint:\")) {\n    console.error(`'${config.weatherEndpoint}' unsupported — use /onecall, /weather or /forecast`);\n  } else throw err;\n}","preventionTips":["Use only path values (/weather, /forecast, /onecall), never full URLs","Check migration notes when upgrading — endpoint names change across versions","Validate weatherEndpoint in a config schema before init","Align type+endpoint combos that the provider actually supports"],"tags":["config","openweathermap","unknown-value"],"backgroundTag":"invalid-enum-value","analyzedSha":"4b4a59534f7da01e4030e46029fe9dd649a7675e","analyzedAt":"2026-08-31T21:49:42.591Z","schemaVersion":2},"datasetVersion":"2026-08-31T22:30:34.772Z"}