-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Conversation
defaultTimeZone = DateTimeZone.forID(newTimeZone); | ||
if (defaultTimeZone == null) { | ||
log.warn("Invalid timezone value: {}", newTimeZone); | ||
throw new ConfigurationException("CalDAV IO", "Invalid timezone value: " + newTimeZone); |
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.
Since we have/use a default timezone already, should we really throw an exception if the timezone in the configuration file isn't valid? Wouldn't it be better to log a warning and proceed to use the default?
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.
And now I see that I've misconfigured this throw statement. So if we keep the throw, it'll have to be fixed up...
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.
Updated to use the default TimeZone if the one specified in configuration is invalid.
String[] keys = key.split(":"); | ||
if (keys.length != 2) { | ||
log.warn("Unable to parse configuration parameter: {}", key); | ||
throw new ConfigurationException("CalDAV IO", "Unable to parse configuration parameter: "+key); |
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.
Here again it seems like we should not throw an exception.
If config is null, log a warning and return.
Switch to using Objects.toString() for reading config values.
Drop the thrown exceptions for missing username/password, since those values are not required.
Add a warning to the log output if the url is not specified in the configuration.
Use the default TimeZone if the one specified in configuration is invalid.
Misc. fixes in openhab_default.cfg and caldavio.cfg.
Fixes #5116