Skip to content

Commit

Permalink
Added more debug info for missing jobs (#2814)
Browse files Browse the repository at this point in the history
* added more info

* added logger

* moved to higher
  • Loading branch information
anandwana001 authored Nov 13, 2024
1 parent e2fcc7b commit be3bd7b
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package com.google.android.ground.persistence.remote.firebase.schema

import com.google.android.ground.FirebaseCrashLogger
import com.google.android.ground.model.Survey
import com.google.android.ground.model.locationofinterest.LocationOfInterest
import com.google.android.ground.persistence.remote.firebase.base.FluentCollectionReference
Expand Down Expand Up @@ -64,7 +65,12 @@ class LoiCollectionReference internal constructor(ref: CollectionReference) :
withContext(defaultDispatcher) {
snapshot.documents.mapNotNull {
toLoi(survey, it)
.onFailure { t -> Timber.w(t, "LOI ${it.id} in remote survey ${survey.id} is invalid") }
.onFailure { t ->
val logger = FirebaseCrashLogger()
logger.setSelectedSurveyId(survey.id)
logger.logException(t)
Timber.w(t, "LOI ${it.id} in remote survey ${survey.id} is invalid")
}
.getOrNull()
}
}
Expand Down

0 comments on commit be3bd7b

Please sign in to comment.