diff --git a/worldguard-core/src/main/java/com/sk89q/worldguard/protection/managers/RegionContainerImpl.java b/worldguard-core/src/main/java/com/sk89q/worldguard/protection/managers/RegionContainerImpl.java index bf4cd158..7af2c8a8 100644 --- a/worldguard-core/src/main/java/com/sk89q/worldguard/protection/managers/RegionContainerImpl.java +++ b/worldguard-core/src/main/java/com/sk89q/worldguard/protection/managers/RegionContainerImpl.java @@ -246,6 +246,8 @@ public void run() { * successfully loaded. */ private class BackgroundLoader extends TimerTask { + private String lastMsg; + @Override public void run() { synchronized (lock) { @@ -261,7 +263,13 @@ public void run() { it.remove(); log.info("Successfully loaded region data for '" + normal.toString() + "'"); } catch (StorageException e) { + if (e.getCause() != null && e.getCause().getMessage().equals(lastMsg)) { + // if it's the same error, don't print a whole stacktrace + log.log(Level.WARNING, "Region data is still failing to load, at least for the world named '" + normal.toString() + "'"); + break; + } log.log(Level.WARNING, "Region data is still failing to load, at least for the world named '" + normal.toString() + "'", e); + lastMsg = e.getCause() == null ? e.getMessage() : e.getCause().getMessage(); break; } } diff --git a/worldguard-core/src/main/java/com/sk89q/worldguard/protection/managers/storage/file/YamlRegionFile.java b/worldguard-core/src/main/java/com/sk89q/worldguard/protection/managers/storage/file/YamlRegionFile.java index 5a6507a2..9aebc5ac 100644 --- a/worldguard-core/src/main/java/com/sk89q/worldguard/protection/managers/storage/file/YamlRegionFile.java +++ b/worldguard-core/src/main/java/com/sk89q/worldguard/protection/managers/storage/file/YamlRegionFile.java @@ -43,6 +43,7 @@ import org.yaml.snakeyaml.DumperOptions.FlowStyle; import org.yaml.snakeyaml.Yaml; import org.yaml.snakeyaml.constructor.SafeConstructor; +import org.yaml.snakeyaml.parser.ParserException; import org.yaml.snakeyaml.representer.Representer; import java.io.File; @@ -118,7 +119,7 @@ public Set loadAll(FlagRegistry flagRegistry) throws StorageExc config.load(); } catch (FileNotFoundException e) { return new HashSet<>(loaded.values()); - } catch (IOException e) { + } catch (IOException | ParserException e) { throw new StorageException("Failed to load region data from '" + file + "'", e); }