[IR] Be ready if message of CompilationException throw exception
This commit is contained in:
+11
-5
@@ -22,11 +22,17 @@ class CompilationException(
|
|||||||
cause: Throwable? = null
|
cause: Throwable? = null
|
||||||
) : RuntimeException(message, cause) {
|
) : RuntimeException(message, cause) {
|
||||||
override val message: String
|
override val message: String
|
||||||
get() = buildString {
|
get() = try {
|
||||||
appendLine("Back-end: Please report this problem https://kotl.in/issue")
|
buildString {
|
||||||
path?.let { appendLine("$it:$line:$column") }
|
appendLine("Back-end: Please report this problem https://kotl.in/issue")
|
||||||
content?.let { appendLine("Problem with `$it`") }
|
path?.let { appendLine("$it:$line:$column") }
|
||||||
append("Details: " + super.message)
|
content?.let { appendLine("Problem with `$it`") }
|
||||||
|
append("Details: " + super.message)
|
||||||
|
}
|
||||||
|
} catch (e: Throwable) {
|
||||||
|
throw IllegalStateException("Problem with constructing exception message").also {
|
||||||
|
it.stackTrace = stackTrace
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val line: Int
|
val line: Int
|
||||||
|
|||||||
Reference in New Issue
Block a user