diff --git a/engine/src/main/java/com/google/android/fhir/sync/upload/UploadStrategy.kt b/engine/src/main/java/com/google/android/fhir/sync/upload/UploadStrategy.kt index 922e4d08e8..a2d141c688 100644 --- a/engine/src/main/java/com/google/android/fhir/sync/upload/UploadStrategy.kt +++ b/engine/src/main/java/com/google/android/fhir/sync/upload/UploadStrategy.kt @@ -82,12 +82,12 @@ private constructor( squash: Boolean, bundleSize: Int, ): UploadStrategy { - if (!squash) { - throw NotImplementedError("No squashing with bundle uploading not supported yet.") - } if (methodForUpdate == HttpUpdateMethod.PUT) { throw NotImplementedError("PUT for UPDATE not supported yet.") } + if (!squash) { + throw NotImplementedError("No squashing with bundle uploading not supported yet.") + } return UploadStrategy( localChangesFetchMode = LocalChangesFetchMode.AllChanges, patchGeneratorMode = PatchGeneratorMode.PerResource, @@ -122,12 +122,12 @@ private constructor( methodForUpdate: HttpUpdateMethod, squash: Boolean, ): UploadStrategy { - require(methodForUpdate != HttpUpdateMethod.PUT || squash) { - "Http method PUT not supported for UPDATE with squash set as false." - } if (methodForUpdate == HttpUpdateMethod.PUT) { throw NotImplementedError("PUT for UPDATE not supported yet.") } + require(methodForUpdate != HttpUpdateMethod.PUT || squash) { + "Http method PUT not supported for UPDATE with squash set as false." + } return UploadStrategy( localChangesFetchMode = if (squash) LocalChangesFetchMode.PerResource else LocalChangesFetchMode.EarliestChange,