Skip to content

Commit

Permalink
Error handling logic for non OperationOutcome errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ndegwamartin committed Oct 9, 2024
1 parent 9255df8 commit b519c23
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,10 @@ abstract class FhirSyncWorker(appContext: Context, workerParams: WorkerParameter
}

open fun onFailedSyncJobResult(failedSyncJobStatus: SyncJobStatus.Failed) {
try {
val jsonParser = FhirContext.forR4().newJsonParser()
val exceptions = (failedSyncJobStatus).exceptions
val jsonParser = FhirContext.forR4().newJsonParser()
val exceptions = (failedSyncJobStatus).exceptions

try {
exceptions.forEach { resourceSyncException ->
val operationOutcome =
jsonParser.parseResource(
Expand All @@ -187,6 +187,7 @@ abstract class FhirSyncWorker(appContext: Context, workerParams: WorkerParameter
}
} catch (e: Exception) {
Timber.e(e)
exceptions?.forEach { Timber.e(it.exception.message) }
}
}

Expand Down

0 comments on commit b519c23

Please sign in to comment.