File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
apollo-coroutines-support/src/main/kotlin/com/apollographql/apollo/coroutines Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -13,9 +13,8 @@ import kotlinx.coroutines.flow.*
13
13
14
14
private class ChannelCallback <T >(val channel : Channel <Response <T >>) : ApolloCall.Callback<T>() {
15
15
16
- @ExperimentalCoroutinesApi
17
16
override fun onResponse (response : Response <T >) {
18
- if ( ! channel.isClosedForSend) {
17
+ runCatching {
19
18
channel.offer(response)
20
19
}
21
20
}
@@ -196,7 +195,9 @@ fun <T> ApolloSubscriptionCall<T>.toChannel(capacity: Int = Channel.UNLIMITED):
196
195
}
197
196
198
197
override fun onResponse (response : Response <T >) {
199
- channel.offer(response)
198
+ runCatching {
199
+ channel.offer(response)
200
+ }
200
201
}
201
202
202
203
override fun onFailure (e : ApolloException ) {
You can’t perform that action at this time.
0 commit comments