diff --git a/server/src/main/kotlin/suwayomi/tachidesk/server/util/AppExit.kt b/server/src/main/kotlin/suwayomi/tachidesk/server/util/AppExit.kt index 871e6a544..41ca249da 100644 --- a/server/src/main/kotlin/suwayomi/tachidesk/server/util/AppExit.kt +++ b/server/src/main/kotlin/suwayomi/tachidesk/server/util/AppExit.kt @@ -16,6 +16,7 @@ enum class ExitCode(val code: Int) { Success(0), MutexCheckFailedTachideskRunning(1), MutexCheckFailedAnotherAppRunning(2), + WebUISetupFailure(3), } fun shutdownApp(exitCode: ExitCode) { diff --git a/server/src/main/kotlin/suwayomi/tachidesk/server/util/WebInterfaceManager.kt b/server/src/main/kotlin/suwayomi/tachidesk/server/util/WebInterfaceManager.kt index 77fe1d669..94826a56d 100644 --- a/server/src/main/kotlin/suwayomi/tachidesk/server/util/WebInterfaceManager.kt +++ b/server/src/main/kotlin/suwayomi/tachidesk/server/util/WebInterfaceManager.kt @@ -47,6 +47,7 @@ import suwayomi.tachidesk.graphql.types.WebUIUpdateStatus import suwayomi.tachidesk.server.ApplicationDirs import suwayomi.tachidesk.server.generated.BuildConfig import suwayomi.tachidesk.server.serverConfig +import suwayomi.tachidesk.server.util.ExitCode.WebUISetupFailure import suwayomi.tachidesk.util.HAScheduler import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get @@ -291,7 +292,15 @@ object WebInterfaceManager { } logger.warn { "setupWebUI: no webUI files found, starting download..." } - doInitialSetup() + try { + doInitialSetup() + } catch (e: Exception) { + logger.error(e) { + "Failed to setup the webUI. Unable to start the server with a served webUI, change the settings to start" + + "without one. Stopping the server now..." + } + shutdownApp(WebUISetupFailure) + } } /**