Skip to content

Commit f523512

Browse files
committed
Better log JcType.classId fails
1 parent d7134b7 commit f523512

File tree

1 file changed

+5
-2
lines changed
  • utbot-junit-contest/src/main/kotlin/org/utbot/contest/usvm/converter

1 file changed

+5
-2
lines changed

utbot-junit-contest/src/main/kotlin/org/utbot/contest/usvm/converter/ConverterUtils.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,11 @@ private fun JcType.replaceToBoundIfGeneric(): JcType {
6767
val JcType?.classId: ClassId
6868
get() {
6969
if (this !is JcPrimitiveType) {
70-
return this?.replaceToBoundIfGeneric()?.toJavaClass(utContext.classLoader)?.id
71-
?: error("Can not construct classId for $this")
70+
return runCatching {
71+
this?.replaceToBoundIfGeneric()?.toJavaClass(utContext.classLoader)?.id ?: error("Can not construct classId for $this")
72+
}.getOrElse { e ->
73+
throw IllegalStateException("JcType.classId failed on ${this?.typeName}", e)
74+
}
7275
}
7376

7477
val cp = this.classpath

0 commit comments

Comments
 (0)