Skip to content

Commit

Permalink
Add LinkingError exit code
Browse files Browse the repository at this point in the history
  • Loading branch information
Duhemm committed Jun 7, 2018
1 parent 27cd1a3 commit f99cd83
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion frontend/src/main/scala/bloop/cli/ExitStatus.scala
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ object ExitStatus {
}

// FORMAT: OFF
val Ok, UnexpectedError, ParseError, InvalidCommandLineOption, CompilationError, TestExecutionError, RunError: ExitStatus = generateExitStatus
val Ok, UnexpectedError, ParseError, InvalidCommandLineOption, CompilationError, LinkingError, TestExecutionError, RunError: ExitStatus = generateExitStatus
// FORMAT: ON

def apply(code: Int): ExitStatus = {
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/main/scala/bloop/engine/Interpreter.scala
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ object Interpreter {
case Some(project) if project.platform != Platform.Native =>
Task {
state.logger.error("This command can only be called on a Scala Native project.")
state.mergeStatus(ExitStatus.RunError)
state.mergeStatus(ExitStatus.InvalidCommandLineOption)
}
case Some(project) =>
val reporter = ReporterKind.toReporterConfig(cmd.reporter)
Expand All @@ -297,7 +297,7 @@ object Interpreter {
state.logger.info(s"Scala Native binary: '${nativeBinary.syntax}'")
state
case Failure(ex) =>
state.mergeStatus(ExitStatus.UnexpectedError)
state.mergeStatus(ExitStatus.LinkingError)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@ class ScalaNativeToolchain private (classLoader: ClassLoader) {
Forker.run(cwd, cmd, state.logger, state.commonOptions).map { exitCode =>
val exitStatus = {
if (exitCode == Forker.EXIT_OK) ExitStatus.Ok
else ExitStatus.UnexpectedError
else ExitStatus.RunError
}
state.mergeStatus(exitStatus)
}
case Failure(ex) =>
Task {
state.logger.error("Couldn't create native binary.")
state.logger.trace(ex)
state.mergeStatus(ExitStatus.UnexpectedError)
state.mergeStatus(ExitStatus.LinkingError)
}
}
}
Expand Down

0 comments on commit f99cd83

Please sign in to comment.