Skip to content

Commit 993fc3a

Browse files
committed
use FirebaseNetworkException as okhhtp states "Called when the request could not be executed due to cancellation, a connectivity problem or timeout. Because networks can fail during an exchange, it is possible that the remote server accepted the request before the failure."
1 parent 247d277 commit 993fc3a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/com/google/firebase/auth/FirebaseAuth.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import com.google.android.gms.tasks.TaskCompletionSource
77
import com.google.android.gms.tasks.Tasks
88
import com.google.firebase.FirebaseApp
99
import com.google.firebase.FirebaseException
10+
import com.google.firebase.FirebaseNetworkException
1011
import com.google.firebase.FirebasePlatform
1112
import com.google.firebase.auth.internal.InternalAuthProvider
1213
import com.google.firebase.internal.InternalTokenResult
@@ -551,7 +552,7 @@ class FirebaseAuth constructor(
551552
.takeUnless { it.task.isComplete }
552553
?: enqueueRefreshTokenCall(user)
553554
refreshSource.task.addOnSuccessListener { source.setResult(map(it)) }
554-
refreshSource.task.addOnFailureListener { source.setException(FirebaseException(it.toString(), it)) }
555+
refreshSource.task.addOnFailureListener { source.setException(FirebaseNetworkException(it.toString())) }
555556
}
556557

557558
private fun enqueueRefreshTokenCall(user: FirebaseUserImpl): TaskCompletionSource<FirebaseUserImpl> {

0 commit comments

Comments
 (0)