From 33a3f7ed789ad0374ea704fd8cf94279a4435784 Mon Sep 17 00:00:00 2001 From: ACGaming <4818419+ACGaming@users.noreply.github.com> Date: Wed, 10 Apr 2024 15:31:41 +0200 Subject: [PATCH] Catch remote config resolving issues --- build.gradle | 2 +- .../core/configuration/ConfigurationController.java | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 5aa4c00..7c98c9e 100644 --- a/build.gradle +++ b/build.gradle @@ -1,2 +1,2 @@ group 'net.jan' -version '1.8.2-SNAPSHOT' +version '1.8.3' diff --git a/mod-director-core/src/main/java/net/jan/moddirector/core/configuration/ConfigurationController.java b/mod-director-core/src/main/java/net/jan/moddirector/core/configuration/ConfigurationController.java index 17fd856..12f3a34 100644 --- a/mod-director-core/src/main/java/net/jan/moddirector/core/configuration/ConfigurationController.java +++ b/mod-director-core/src/main/java/net/jan/moddirector/core/configuration/ConfigurationController.java @@ -17,6 +17,7 @@ import net.jan.moddirector.core.util.WebGetResponse; import java.io.*; +import java.net.UnknownHostException; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; @@ -116,6 +117,9 @@ private void handleRemoteConfig(Path configurationPath) { Files.write(remoteConfigPath, outputStream.toByteArray()); addConfig(remoteConfigPath); Files.delete(remoteConfigPath); + } catch(UnknownHostException e) { + director.getLogger().logThrowable(ModDirectorSeverityLevel.ERROR, LOG_DOMAIN, + "CORE", e, "Failed to resolve URL %s, skipping remote config...", remoteConfig.getUrl()); } } catch(IOException e) { handleConfigException(e);