Scripting: switch legacy CLI REPL to the new infrastructure
This commit is contained in:
+1
-1
@@ -98,7 +98,7 @@ abstract class KotlinJsr223JvmScriptEngineBase(protected val myFactory: ScriptEn
|
||||
is ReplEvalResult.Error ->
|
||||
when {
|
||||
result is ReplEvalResult.Error.Runtime && result.cause != null ->
|
||||
throw ScriptException(result.cause)
|
||||
throw ScriptException((result.cause as? java.lang.Exception) ?: RuntimeException(result.cause))
|
||||
result is ReplEvalResult.Error.CompileTime && result.location != null ->
|
||||
throw ScriptException(result.message, result.location.path, result.location.line, result.location.column)
|
||||
else -> throw ScriptException(result.message)
|
||||
|
||||
@@ -148,7 +148,7 @@ sealed class ReplEvalResult : Serializable {
|
||||
}
|
||||
|
||||
sealed class Error(val message: String) : ReplEvalResult() {
|
||||
class Runtime(message: String, val cause: Exception? = null) : Error(message) {
|
||||
class Runtime(message: String, val cause: Throwable? = null) : Error(message) {
|
||||
companion object { private val serialVersionUID: Long = 1L }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user