[K/N] Don't cut cinterop exceptions from TC logs.

This commit is contained in:
Vladimir Sukharev
2024-02-03 21:14:16 +01:00
committed by Space Team
parent 53c5230520
commit f00a145dd7
2 changed files with 6 additions and 1 deletions
@@ -85,6 +85,11 @@ class Interop {
interop(flavor, args, internalInteropOptions, runFromDaemon)
} catch (prettyException: CInteropPrettyException) {
prettyException
} catch (throwable: Throwable) {
// Return Throwable to be printed to logs by invoker, instead of allowing unprettified exception to be thrown through reflection invocation,
// which otherwise will be replaced with InvocationTargetException with null error message and huge stacktrace which TeamCity cuts,
// so "Caused by:" part is not saved to the log.
throwable
}
}
@@ -148,7 +148,7 @@ internal fun invokeCInterop(
cinteropResult is Exception -> {
CompilationToolCallResult(
exitCode = ExitCode.COMPILATION_ERROR,
toolOutput = cinteropResult.message ?: "",
toolOutput = cinteropResult.stackTraceToString(),
toolOutputHasErrors = true,
duration
)