Skip to content

Commit e4dcca1

Browse files
committed
fix(logging): filter FIS_AUTH_ERROR from Bugsnag reports
Firebase Installations Service auth errors are transient and not actionable from the client. Expand isGmsTransientError() to catch FIS_AUTH_ERROR and walk the full cause chain so nested IOExceptions are detected. Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
1 parent d6deda3 commit e4dcca1

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

libs/logging/src/main/kotlin/com/getcode/utils/ErrorUtils.kt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,11 @@ object ErrorUtils {
8080
throwable is UnknownHostException ||
8181
throwable.cause is UnknownHostException
8282

83-
private fun isGmsTransientError(throwable: Throwable): Boolean {
84-
fun check(t: Throwable?) = t is java.io.IOException && t.message == "SERVICE_NOT_AVAILABLE"
85-
return check(throwable) || check(throwable.cause)
86-
}
83+
private val gmsTransientMessages = setOf("SERVICE_NOT_AVAILABLE", "FIS_AUTH_ERROR")
84+
85+
private fun isGmsTransientError(throwable: Throwable): Boolean =
86+
generateSequence(throwable) { it.cause }
87+
.any { it is java.io.IOException && it.message in gmsTransientMessages }
8788

8889
val ignoredGrpcStatusCodes = setOf(
8990
// Transport/transient

0 commit comments

Comments
 (0)