mirror of
https://github.com/apple/pkl.git
synced 2026-03-17 23:03:54 +01:00
Emit error stack trace on non Pkl exceptions (#1402)
If the thrown error is not a Pkl exception, some internal error occurred, and we need to emit the stack trace for visibility.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright © 2024-2025 Apple Inc. and the Pkl project authors. All rights reserved.
|
||||
* Copyright © 2024-2026 Apple Inc. and the Pkl project authors. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -20,6 +20,7 @@ import org.pkl.commons.cli.*
|
||||
import org.pkl.core.Closeables
|
||||
import org.pkl.core.EvaluatorBuilder
|
||||
import org.pkl.core.ModuleSource.uri
|
||||
import org.pkl.core.PklException
|
||||
import org.pkl.core.TestResults
|
||||
import org.pkl.core.stdlib.test.report.JUnitReport
|
||||
import org.pkl.core.stdlib.test.report.SimpleReport
|
||||
@@ -106,6 +107,9 @@ constructor(
|
||||
} catch (ex: Exception) {
|
||||
errWriter.appendLine("Error evaluating module ${moduleUri.path}:")
|
||||
errWriter.write(ex.message ?: "")
|
||||
if (ex !is PklException) {
|
||||
errWriter.write(ex.stackTraceToString())
|
||||
}
|
||||
if (moduleUri != sources.last()) {
|
||||
errWriter.appendLine()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user