Skip to content

Commit f112743

Browse files
should crash if the install fails now, closes #40
1 parent 67dfcea commit f112743

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

src/main/kotlin/atm/bloodworkxgaming/serverstarter/FileManager.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ class FileManager(private val configFile: ConfigFile, private val internetManage
2020

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

2528
private fun handleAdditionalFile(file: AdditionalFile, fallbackList: MutableList<AdditionalFile>) {
@@ -49,6 +52,7 @@ class FileManager(private val configFile: ConfigFile, private val internetManage
4952
}
5053
} catch (e: IOException) {
5154
LOGGER.error("Error while copying local file", e)
55+
throw e
5256
}
5357
}
5458
}

src/main/kotlin/atm/bloodworkxgaming/serverstarter/LoaderManager.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ class LoaderManager(private val configFile: ConfigFile, private val internetMana
7171
} catch (e: InterruptedException) {
7272
e.printStackTrace()
7373
}
74-
7574
}
7675

7776
} while (shouldRestart)
@@ -183,6 +182,7 @@ class LoaderManager(private val configFile: ConfigFile, private val internetMana
183182
internetManager.downloadToFile(configFile.install.spongeBootstrapper, downloadFile)
184183
} catch (e: IOException) {
185184
LOGGER.error("Error while downloading bootstrapper", e)
185+
throw e
186186
}
187187

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

200200
props["level-name"] as String?
201201
} catch (e: FileNotFoundException) {
202-
"world"
202+
null
203203
}
204204

205205
val filename =

src/main/kotlin/atm/bloodworkxgaming/serverstarter/packtype/curse/CursePackType.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ open class CursePackType(private val configFile: ConfigFile, internetManager: In
117117
}
118118
} catch (e: IOException) {
119119
LOGGER.error("Could not unzip files", e)
120+
throw e
120121
}
121122

122123
LOGGER.info("Done unzipping the files.")

0 commit comments

Comments
 (0)