Closed jokajak closed 3 years ago
This logging already exists. If you're using PM2, you'll see it when you run pm2 logs mm
. Otherwise if you're running it from the command line, you see such errors there.
Specific code is in node_help.js, lines 37-41:
if (payload.apikey == null || payload.apikey == "") {
console.log( "[MMM-OpenWeatherForecast] " + moment().format("D-MMM-YY HH:mm") + " ** ERROR ** No API key configured. Get an API key at https://darksky.net" );
} else if (payload.latitude == null || payload.latitude == "" || payload.longitude == null || payload.longitude == "") {
console.log( "[MMM-OpenWeatherForecast] " + moment().format("D-MMM-YY HH:mm") + " ** ERROR ** Latitude and/or longitude not provided." );
} else {
Simple PEBKAC request, I used
lat
andlon
instead oflatitude
andlongitude
and wondered why it wasn't working. It would be nice if an error message was logged when required configuration values are missing.Nice work!