fix(compatibility/LunarClient): wrap backup in try catch (#5974)

Also reverts a0f3a8d26d
This commit is contained in:
Izuna
2025-03-31 00:36:02 +02:00
committed by GitHub
parent 940f6e7f4d
commit 4a0d897ecb
2 changed files with 5 additions and 1 deletions

View File

@@ -71,6 +71,8 @@ final excludeProvidedLibs = {
exclude group: "net.java.dev.jna", module: "jna"
exclude group: "commons-codec", module: "commons-codec"
exclude group: "commons-io", module: "commons-io"
exclude group: "org.apache.commons", module: "commons-compress"
exclude group: "org.apache.commons", module: "commons-lang3"
exclude group: "org.apache.logging.log4j", module: "log4j-core"
exclude group: "org.apache.logging.log4j", module: "log4j-api"
exclude group: "org.apache.logging.log4j", module: "log4j-slf4j-impl"

View File

@@ -107,8 +107,10 @@ object ConfigSystem {
/**
* Create a ZIP file of root configurable files
*/
fun backup(fileName: String) {
fun backup(fileName: String) = runCatching {
configurables.map { it.jsonFile }.createZipArchive(File(rootFolder, fileName))
}.onFailure {
logger.error("Unable to create backup", it)
}
/**