Skip to content
This repository has been archived by the owner on May 17, 2021. It is now read-only.

[CalDAV] Various configuration fixes #5117

Merged
merged 11 commits into from
Mar 15, 2017
Merged

[CalDAV] Various configuration fixes #5117

merged 11 commits into from
Mar 15, 2017

Conversation

9037568
Copy link
Contributor

@9037568 9037568 commented Feb 26, 2017

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

defaultTimeZone = DateTimeZone.forID(newTimeZone);
if (defaultTimeZone == null) {
log.warn("Invalid timezone value: {}", newTimeZone);
throw new ConfigurationException("CalDAV IO", "Invalid timezone value: " + newTimeZone);
Copy link
Contributor Author

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?

Copy link
Contributor Author

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...

Copy link
Contributor Author

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);
Copy link
Contributor Author

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.

@9037568 9037568 added this to the 1.10.0 milestone Mar 4, 2017
@9037568 9037568 merged commit fd214d4 into openhab:master Mar 15, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Caldav] No warnings in log for missing required configuration settings
1 participant