Skip to content

Commit

Permalink
should crash if the install fails now, closes BloodyMods#40
Browse files Browse the repository at this point in the history
  • Loading branch information
BloodWorkXGaming committed Oct 17, 2021
1 parent 67dfcea commit f112743
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ class FileManager(private val configFile: ConfigFile, private val internetManage

val failList = mutableListOf<AdditionalFile>()
fallbackList.parallelStream().forEach { file -> handleAdditionalFile(file, failList) }
if (failList.isNotEmpty()) {
throw RuntimeException("Could not download all additional files! [$failList]")
}
}

private fun handleAdditionalFile(file: AdditionalFile, fallbackList: MutableList<AdditionalFile>) {
Expand Down Expand Up @@ -49,6 +52,7 @@ class FileManager(private val configFile: ConfigFile, private val internetManage
}
} catch (e: IOException) {
LOGGER.error("Error while copying local file", e)
throw e
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ class LoaderManager(private val configFile: ConfigFile, private val internetMana
} catch (e: InterruptedException) {
e.printStackTrace()
}

}

} while (shouldRestart)
Expand Down Expand Up @@ -183,6 +182,7 @@ class LoaderManager(private val configFile: ConfigFile, private val internetMana
internetManager.downloadToFile(configFile.install.spongeBootstrapper, downloadFile)
} catch (e: IOException) {
LOGGER.error("Error while downloading bootstrapper", e)
throw e
}

return filename
Expand All @@ -199,7 +199,7 @@ class LoaderManager(private val configFile: ConfigFile, private val internetMana

props["level-name"] as String?
} catch (e: FileNotFoundException) {
"world"
null
}

val filename =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ open class CursePackType(private val configFile: ConfigFile, internetManager: In
}
} catch (e: IOException) {
LOGGER.error("Could not unzip files", e)
throw e
}

LOGGER.info("Done unzipping the files.")
Expand Down

0 comments on commit f112743

Please sign in to comment.