Keep attachments of cause exception in KotlinExceptionWithAttachments and provide elements in attachments in case of errors during kotlin idea resolution
Relates to EA-210942, EA-209622 etc
This commit is contained in:
@@ -13,7 +13,11 @@ open class KotlinExceptionWithAttachments : RuntimeException, ExceptionWithAttac
|
|||||||
|
|
||||||
constructor(message: String) : super(message)
|
constructor(message: String) : super(message)
|
||||||
|
|
||||||
constructor(message: String?, cause: Throwable?) : super(message, cause)
|
constructor(message: String?, cause: Throwable?) : super(message, cause) {
|
||||||
|
if (cause is KotlinExceptionWithAttachments) {
|
||||||
|
attachments.addAll(cause.attachments)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
override fun getAttachments(): Array<Attachment> = attachments.toTypedArray()
|
override fun getAttachments(): Array<Attachment> = attachments.toTypedArray()
|
||||||
|
|
||||||
|
|||||||
+4
-1
@@ -118,6 +118,9 @@ private class KotlinIdeaResolutionException(
|
|||||||
appendln("---------------------------------------------")
|
appendln("---------------------------------------------")
|
||||||
append(creationPlace.description())
|
append(creationPlace.description())
|
||||||
})
|
})
|
||||||
|
for (element in resolvingWhat.elements.withIndex()) {
|
||||||
|
withAttachment("element${element.index}.kt", element.value.text)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -142,7 +145,7 @@ private class CreationPlace(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private class ResolvingWhat(
|
private class ResolvingWhat(
|
||||||
private val elements: Collection<PsiElement> = emptyList(),
|
val elements: Collection<PsiElement> = emptyList(),
|
||||||
private val bodyResolveMode: BodyResolveMode? = null,
|
private val bodyResolveMode: BodyResolveMode? = null,
|
||||||
private val serviceClass: Class<*>? = null,
|
private val serviceClass: Class<*>? = null,
|
||||||
private val moduleDescriptor: ModuleDescriptor? = null
|
private val moduleDescriptor: ModuleDescriptor? = null
|
||||||
|
|||||||
Reference in New Issue
Block a user