diff --git a/build.gradle b/build.gradle index d5a313b07a..551708d4e4 100644 --- a/build.gradle +++ b/build.gradle @@ -2,7 +2,7 @@ buildscript { ext { - kotlin_version = '1.8.10' + kotlin_version = '1.8.21' core_version = '1.10.0' rxjava_version = '3.1.6' rxandroid_version = '3.0.2' diff --git a/core/ns-sdk/src/main/java/info/nightscout/sdk/NSAndroidClientImpl.kt b/core/ns-sdk/src/main/java/info/nightscout/sdk/NSAndroidClientImpl.kt index 7f8c934aa2..1f07e76a17 100644 --- a/core/ns-sdk/src/main/java/info/nightscout/sdk/NSAndroidClientImpl.kt +++ b/core/ns-sdk/src/main/java/info/nightscout/sdk/NSAndroidClientImpl.kt @@ -292,14 +292,11 @@ class NSAndroidClientImpl( lastModified = response.body()?.lastModified ) } else throw UnknownResponseNightscoutException() - } else if (response.code() in 400..499) { - return@callWrapper CreateUpdateResponse( - response = response.code(), - identifier = null, - errorResponse = response.errorBody()?.string() ?: response.message() - ) - } else - throw UnsuccessfullNightscoutException(response.errorBody()?.string() ?: response.message()) + } else return@callWrapper CreateUpdateResponse( + response = response.code(), + identifier = null, + errorResponse = response.errorBody()?.string() ?: response.message() + ) } override suspend fun createTreatment(nsTreatment: NSTreatment): CreateUpdateResponse = callWrapper(dispatcher) { diff --git a/gradle.properties b/gradle.properties index 873792f7a9..3b47fa6324 100644 --- a/gradle.properties +++ b/gradle.properties @@ -24,3 +24,11 @@ android.useAndroidX=true android.nonTransitiveRClass=true # Cache is causeing issues with CircleCI nad maybe Studio 2021 # org.gradle.unsafe.configuration-cache=true + +# After migration to kotlin 1.8.21 +#e: org.jetbrains.kotlin.backend.common.BackendException: Backend Internal error: Exception during psi2ir +# File being compiled: (37,18) in /home/circleci/project/core/interfaces/src/main/java/info/nightscout/interfaces/pump/defs/PumpCapability.kt +# The root cause org.jetbrains.kotlin.psi2ir.generators.ErrorExpressionException was thrown at: org.jetbrains.kotlin.psi2ir.generators.ErrorExpressionGenerator.generateErrorCall(ErrorExpressionGenerator.kt:100) +# null: KtCallExpression +# https://youtrack.jetbrains.com/issue/KT-58027 +kapt.use.jvm.ir=false