getPreferenceOrThrow

suspend fun <T> getPreferenceOrThrow(key: String): T

Get preference value by key or throw suspending coroutine

Return

The value of the preference or throw if not found

Parameters

key

Preference key

Throws

PreferenceNotFoundException

If the preference is not found or is null