Hey guys, I'm trying to setup error handling using...
# announcements
j
Hey guys, I'm trying to setup error handling using retrofit but I'm having compiler issues. The following code:
Copy code
val annotation = object : Annotation{}
val array:Array<Annotation> = arrayOf(annotation)
val converter: retrofit2.Converter<ResponseBody, APIError> =
    APIServiceProvider.retrofit.responseBodyConverter(
        APIError::class.java,
        array)
generates this BE (JVM) internal error:
Copy code
Error:(40, 43) org.jetbrains.kotlin.codegen.CompilationException: Back-end (JVM) Internal error: Couldn't inline method call 'arrayOf' into
{
            val annotation = object : Annotation{}
            val array:Array<Annotation> = arrayOf(annotation)
            val converter: retrofit2.Converter<ResponseBody, APIError> =
                APIServiceProvider.retrofit!!.responseBodyConverter(
                    APIError::class.java,
                    array)
            val error = converter.convert(it)
            Log.e("API", "Error on $call: $error")
            onError(APIError(it.string(), response.code()))
        }
cause: Not generated
Cause: Couldn't find declaration file for kotlin/KotlinPackage
Any idea what's going on ?