We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 30edff5 commit 286c7dbCopy full SHA for 286c7db
src/main/kotlin/com/moumoux/quinine/Quinine.kt
@@ -79,7 +79,13 @@ class Quinine<K: Any, V> private constructor() {
79
fun <K1 : K, V1 : V?> build(mappingFunction: suspend (K1) -> V1): LoadingCache<K1, V1> {
80
return LoadingCacheDelegate(caffeine.build {
81
Single.create<V1> { emitter ->
82
- GlobalScope.launch { emitter.onSuccess(mappingFunction(it)) }
+ GlobalScope.launch {
83
+ try {
84
+ emitter.onSuccess(mappingFunction(it))
85
+ } catch (e: Throwable) {
86
+ emitter.onError(e)
87
+ }
88
89
}.cache()
90
})
91
}
0 commit comments