-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[WeatherBinding] Add log messages for invalid configurations #4458
Conversation
Also prevent duplicate warnings on binding change.
if (config == null) { | ||
logger.warn("Unable to find any configuration settings for weather binding. Check openhab.cfg."); | ||
throw new ConfigurationException("weather", "Unable to find any configuration settings for weather binding. Check openhab.cfg."); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you certain that there aren't expected situations when updated
is called with a null
config? A thorough exercise under OH 1.8.3 and OH 2 might reveal if this is correct; perhaps you've already done that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're thinking we shouldn't throw an exception here, but just issue a warning? I'd be ok with that.
I can't think of any situations when updated
would be called with a null
config, though. I've run through quite a number of test scenarios without seeing any bad behaviour.
At any rate, if you prefer to not throw an exception here, I'll change it.
} else if (StringUtils.startsWithIgnoreCase(key, "location")) { | ||
parseLocation(key, value); | ||
} | ||
if (properties == null ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Chris, please format your changes with the Eclipse IDE formatter, so they won't be reformatted on the next commit.
Thanks, Chris. Please see my last comments. |
Thanks Chris! |
* master: (178 commits) Fix the generateDeviceId method. (openhab#4498) [modbus] Add support for int32_swap, uint32_swap and float32_swap data types (openhab#4251) Extend error logging on retry failure (openhab#4477) Changed timestamp of item insert from MySql server time to local Java… (openhab#4503) [mochadx10] Add binding to OH2 distro (openhab#4502) [mqtt] Add openhab-action-mqtt feature for OH2 install (openhab#4499) ZWave database update (openhab#4497) Fixes openhab#1003 (openhab#4162) [WeatherBinding] Add log messages for invalid configurations (openhab#4458) Network Health - Made log message more clear (openhab#4425) Update ZMNHSD (openhab#4490) Update clock command class and converter (openhab#4489) Updated modbus config template with serial example. Documented advanced connection parameters (openhab#4487) ZWave update WA105DBZ (openhab#4485) Zwave database 180616 (openhab#4483) Zwave database 180616 (openhab#4479) Add Aeon ZW112 - Door/Window Sensor 6 (openhab#4472) Include Aeon ZW112 - Door/Window Sensor 6 (openhab#4471) Z-Wave: Added support for CENTRAL_SCENE (openhab#4431) ZWave database update (openhab#4476) ... # Conflicts: # bundles/binding/org.openhab.binding.zwave/database/products.xml # bundles/binding/org.openhab.binding.zwave/src/main/java/org/openhab/binding/zwave/internal/converter/ZWaveConverterHandler.java # bundles/binding/org.openhab.binding.zwave/src/main/java/org/openhab/binding/zwave/internal/protocol/commandclass/ZWaveCommandClass.java
In order to prevent silent failures of the weather binding (see #4337), record appropriate log messages.
Also prevent duplicate warnings on binding change.