Skip to content

Commit ec0fafa

Browse files
committed
KST translator: log "... generating $outFile" even if it fails
Previously, in the case of a `NotImplementedError` thrown when translating KST specs with the `exception` key to some languages (namely Construct, Nim and Rust), the full stack trace of the `scala.NotImplementedError: an implementation is missing` error was printed to the console 3 times when using `./spec_kst_to_all -t all ...`, but it was not clear from the output for which targets it actually occurred. To fix this, this commit ensures that the "... generating $outFile" message is printed even if the generation fails (not just on success) - the "... generating $outFile" message right before the error in the console output then tells exactly which spec failed to be generated.
1 parent 8d98329 commit ec0fafa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

translator/src/main/scala/io/kaitai/struct/testtranslator/TestTranslator.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ class TestTranslator(options: CLIOptions) {
3232
langs.foreach(langName => {
3333
val sg = getSG(langName, testSpec, provider)
3434
try {
35-
sg.run()
3635
val outFile = s"$outDir/$langName/${sg.fileName(testName)}"
3736
Console.println(s"... generating $outFile")
37+
sg.run()
3838
writeFile(outFile, sg.results)
3939
} catch {
4040
case e: Throwable => e.printStackTrace(Console.err)

0 commit comments

Comments
 (0)