storageCall

inline suspend fun <T> storageCall(crossinline block: suspend () -> T): T(source)

Runs block, a read or write of local storage, and rethrows a storage failure as StorageException.

Repositories wrap their DataStore or database calls in it so their callers see one exception type whatever the storage library threw. Cancellation and failures that are not storage failures pass through unchanged.