Config file parsing is too lenient
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
unity-scopes-api (Ubuntu) |
New
|
Medium
|
Unassigned |
Bug Description
We have a few places in the *Config classes where settings that are not strings are not verified.
For example, setting Pageheader.Logo = 42 causes a meaningless exception to be thrown
ages after the damage was done, instead of telling the scope author "you did something silly
in the following file when you set Pageheader.Logo".
Any settings that are not strings need to be parsed to the extent that at least their type
is in agreement with their expected type. Silently ignoring them is not good enough,
and silently parsing something as an int when it should be a boolean is also not good enough.
If we have settings that need to conform to some internal syntax, such as URLs, we probably
should also verify that the string at least parses as a URL when we parse the config. That is
infinitely better than producing an error message half an hour later that, in essence, can
only say "bad URL", but not necessarily tell me where the mistake was made in the first place.
Doing this also allows code that uses config values to use them with confidence, at least to the extent that they will have the expected type. If we don't parse the config files up-front, then we need to re-verify that that settings are sane in every place where are setting is used.
affects: | unity-scopes-api → unity-scopes-api (Ubuntu) |