Skip to content

Commit c551f51

Browse files
authored
Merge pull request #723 from code-payments/fix/filter-fis-auth-error
fix(logging): filter FIS_AUTH_ERROR from Bugsnag reports
2 parents 4da83d9 + e4dcca1 commit c551f51

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)