Allow CrashLogsManager to handle generic Throwables (#4106)

This commit is contained in:
David Perez 2024-10-17 08:55:41 -05:00 committed by GitHub
parent 655beb9dd6
commit a9b6f296d8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 5 additions and 5 deletions

View file

@ -12,5 +12,5 @@ class CrashLogsManagerImpl(
) : CrashLogsManager {
override var isEnabled: Boolean = true
override fun trackNonFatalException(e: Exception) = Unit
override fun trackNonFatalException(throwable: Throwable) = Unit
}

View file

@ -11,7 +11,7 @@ interface CrashLogsManager {
var isEnabled: Boolean
/**
* Tracks an exception if logs are enabled.
* Tracks a [Throwable] if logs are enabled.
*/
fun trackNonFatalException(e: Exception)
fun trackNonFatalException(throwable: Throwable)
}

View file

@ -22,9 +22,9 @@ class CrashLogsManagerImpl(
Firebase.crashlytics.isCrashlyticsCollectionEnabled = value
}
override fun trackNonFatalException(e: Exception) {
override fun trackNonFatalException(throwable: Throwable) {
if (settingsRepository.isCrashLoggingEnabled) {
Firebase.crashlytics.recordException(e)
Firebase.crashlytics.recordException(throwable)
}
}