From 6025aca47cecc7ac4845dc1583813de405da55b3 Mon Sep 17 00:00:00 2001 From: Naomi Plasterer Date: Mon, 6 Nov 2023 19:44:32 -0800 Subject: [PATCH] try to fix the grpc error --- .../main/java/org/xmtp/android/library/Conversations.kt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/library/src/main/java/org/xmtp/android/library/Conversations.kt b/library/src/main/java/org/xmtp/android/library/Conversations.kt index 728d74898..154b8424c 100644 --- a/library/src/main/java/org/xmtp/android/library/Conversations.kt +++ b/library/src/main/java/org/xmtp/android/library/Conversations.kt @@ -1,6 +1,7 @@ package org.xmtp.android.library import android.util.Log +import io.grpc.StatusException import kotlinx.coroutines.CancellationException import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.MutableStateFlow @@ -400,6 +401,12 @@ data class Conversations( } } catch (error: CancellationException) { break + } catch (error: StatusException) { + if (error.status.code == io.grpc.Status.Code.UNAVAILABLE) { + continue + } else { + break + } } catch (error: Exception) { continue }