getPropertyOrThrow

Retrieves a custom property by name, throwing an exception if not found.

This is useful when a property is required and its absence indicates a configuration error. Prefer this over Feature.getProperty when you want to fail fast on missing properties.

Example:

val apiKeyProp = feature.getPropertyOrThrow<String>("apiKey")
val apiKey = apiKeyProp.value

Return

the property with the specified name

Parameters

T

the expected type of the property

name

the name of the property to retrieve

Throws

if no property with the given name exists


Retrieves a property by name, throwing an exception if not found.

This is useful when a property is required and its absence indicates a configuration error. Prefer this over nullable PropertyStore.get when you want to fail fast on missing properties.

Example:

// Require a property to exist
val apiKeyProperty = store.getPropertyOrThrow<String>("apiKey")
val apiKey = apiKeyProperty.value

// This will throw if the property doesn't exist
val requiredConfig = store.getPropertyOrThrow<Int>("requiredSetting")

Return

the property with the specified name

Parameters

T

the expected type of the property

name

the name of the property to retrieve

Throws

if no property with the given name exists