in src/main/kotlin/com/compiler/server/model/ProgramOutput.kt [23:36]
fun asExecutionResult(): JvmExecutionResult {
return when {
restriction != null -> JvmExecutionResult().apply { text = buildRestriction(restriction) }
exception != null -> JvmExecutionResult(exception = exception.toExceptionDescriptor())
standardOutput.isBlank() -> JvmExecutionResult()
else -> {
try {
outputMapper.readValue(standardOutput, JvmExecutionResult::class.java)
} catch (e: Exception) {
JvmExecutionResult(exception = e.toExceptionDescriptor())
}
}
}
}