Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed demo app crash by appropriately handing ResourceNotFoundException. #2152

Merged
merged 6 commits into from
Sep 7, 2023
Merged
Prev Previous commit
Next Next commit
Remove unnecessary code
  • Loading branch information
aditya-07 committed Sep 5, 2023
commit 2e484ec8376a35163c8f9fb299917eae0850bac2
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import com.google.android.fhir.NetworkConfiguration
import com.google.android.fhir.ServerConfiguration
import com.google.android.fhir.datacapture.DataCaptureConfig
import com.google.android.fhir.datacapture.XFhirQueryResolver
import com.google.android.fhir.db.ResourceNotFoundException
import com.google.android.fhir.search.search
import com.google.android.fhir.sync.remote.HttpLogger
import timber.log.Timber
Expand Down Expand Up @@ -64,14 +63,7 @@ class FhirApplication : Application(), DataCaptureConfig.Provider {
dataCaptureConfig =
DataCaptureConfig().apply {
urlResolver = ReferenceUrlResolver(this@FhirApplication as Context)
xFhirQueryResolver = XFhirQueryResolver {
try {
fhirEngine.search(it).map { it.resource }
} catch (e: ResourceNotFoundException) {
Timber.e(e)
emptyList()
}
}
xFhirQueryResolver = XFhirQueryResolver { fhirEngine.search(it).map { it.resource } }
}
}

Expand Down
Loading