Skip to content

Commit

Permalink
Report raw, unparsed error streams as a last resort.
Browse files Browse the repository at this point in the history
  • Loading branch information
petervdonovan authored and cmnrd committed Feb 7, 2022
1 parent a927878 commit b0316f1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion org.lflang/src/org/lflang/generator/rust/RustGenerator.kt
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,9 @@ class RustGenerator(
} else if (context.cancelIndicator.isCanceled) {
context.finish(GeneratorResult.CANCELLED)
} else {
if (!errorsOccurred()) errorReporter.reportError("cargo failed with error code $cargoReturnCode")
if (!errorsOccurred()) errorReporter.reportError(
"cargo failed with error code $cargoReturnCode and reported the following error(s):\n${cargoCommand.errors}"
)
context.finish(GeneratorResult.FAILED)
}
}
Expand Down
6 changes: 3 additions & 3 deletions org.lflang/src/org/lflang/generator/ts/TSGenerator.kt
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ class TSGenerator(
val protoc = commandFactory.createCommand("protoc", protocArgs, tsFileConfig.srcPath)

if (protoc == null) {
errorReporter.reportError("Processing .proto files requires libprotoc >= 3.6.1")
errorReporter.reportError("Processing .proto files requires libprotoc >= 3.6.1.")
return
}

Expand All @@ -393,7 +393,7 @@ class TSGenerator(
// targetConfig.compileLibraries.add('-l')
// targetConfig.compileLibraries.add('protobuf-c')
} else {
errorReporter.reportError("protoc returns error code $returnCode")
errorReporter.reportError("protoc failed with error code $returnCode.")
}
// FIXME: report errors from this command.
}
Expand Down Expand Up @@ -426,7 +426,7 @@ class TSGenerator(
if (babel.run(cancelIndicator) == 0) {
println("SUCCESS (compiling generated TypeScript code)")
} else {
errorReporter.reportError("Compiler failed.")
errorReporter.reportError("Compiler failed with the following errors:\n${babel.errors}")
}
}

Expand Down

0 comments on commit b0316f1

Please # to comment.