Show download exceptions properly in CLI

This commit is contained in:
comp500
2020-12-11 18:18:10 +00:00
parent 60887a4312
commit f52cd19ad4
2 changed files with 15 additions and 4 deletions

View File

@@ -3,6 +3,7 @@ package link.infra.packwiz.installer.ui
import link.infra.packwiz.installer.ui.IUserInterface.ExceptionListResult
import java.util.concurrent.CompletableFuture
import java.util.concurrent.Future
import kotlin.system.exitProcess
class CLIHandler : IUserInterface {
override fun handleException(e: Exception) {
@@ -40,8 +41,11 @@ class CLIHandler : IUserInterface {
}
override fun showExceptions(exceptions: List<ExceptionDetails>, numTotal: Int, allowsIgnore: Boolean): Future<ExceptionListResult> {
val future = CompletableFuture<ExceptionListResult>()
future.complete(ExceptionListResult.CANCEL)
return future
println("Failed to download modpack, the following errors were encountered:")
for (ex in exceptions) {
println(ex.name + ": ")
ex.exception.printStackTrace()
}
exitProcess(1)
}
}