The doc for Properties.getValue() claims
Property values must be defined in the application settings xml. If a key that is not present in application settings is passed to getValue(), an exception will be thrown.
- (Properties.InvalidKeyException) —
Thrown if key does not exist in Application Settings
But the doc for Properties.setValue() claims
-
(Properties.InvalidKeyException) —
Thrown if key does not exist in Application Properties
The CIQ Core Topics > Persisting Data docs also says the following for both getValue and setValue:
Property values must be defined in the application settings xml. If a key that is not present in application settings is passed to
Properties.getValue()
, an exception will be thrown
The actual observed behavior for Properties.getValue("someKey"), on a simulated fr965:
- key present in app properties with string value, with no corresponding setting
getValue() successfully retrieves the corresponding value from properties
- key not present in properties or settings (but application has 0 properties defined in resources):
The following error was returned (at the Properties.getValue() call):
Error: Unexpected Type Error
Details: Failed invoking <symbol>
- key not present in properties or settings (but application has > 0 properties defined in resources)
The following exception was thrown:Error: Unhandled Exception
Exception: Key does not exist in Application Properties
I verified that this is indeed Properties.InvalidKeyException
by catching the exception and using instanceof
It's also worth noting that there's a clear typo in Core Topics > Persisting Data.
Properties.getValue() is accurately described as follows: "Retrieve information by key from properties."
But Properties.setValue() has the following misleading / incorrect description: "Store information by key in persisted storage."
This seems to be a copy-paste error from the description for Storage.getValue() on the same page