Skip to content

Commit

Permalink
Fail early if starting Scala.js sub-process failed
Browse files Browse the repository at this point in the history
  • Loading branch information
alexarchambault committed Jul 14, 2022
1 parent aab6634 commit 03b69e4
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import scala.build.errors.{
TooManyFrameworksFoundByBridgeError
}
import scala.build.testrunner.{AsmTestRunner, TestRunner}
import scala.util.Properties
import scala.util.{Failure, Properties, Success}

object Runner {

Expand Down Expand Up @@ -251,6 +251,12 @@ object Runner {
val config = RunConfig().withLogger(logger.scalaJsLogger)
val processJs = envJs.start(inputs, config)

processJs.future.value.foreach {
case Failure(t) =>
throw new Exception(t)
case Success(_) =>
}

val processField =
processJs.getClass.getDeclaredField("org$scalajs$jsenv$ExternalJSRun$$process")
processField.setAccessible(true)
Expand Down

0 comments on commit 03b69e4

Please sign in to comment.