Skip to content

Commit fa1e10e

Browse files
committed
Provide problematic config file when erroring on legacy config check. Fixes #735
1 parent 520492d commit fa1e10e

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

common/src/main/java/de/bluecolored/bluemap/common/config/BlueMapConfigManager.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -310,9 +310,15 @@ private Map<String, MapConfig> loadMapConfigs(Collection<ServerWorld> autoConfig
310310
"To resolve this issue, rename this file to something else.");
311311
}
312312

313-
MapConfig mapConfig = configManager.loadConfig(configFile, MapConfig.class);
314-
mapConfig.checkLegacy();
315-
mapConfigs.put(id, mapConfig);
313+
try {
314+
MapConfig mapConfig = configManager.loadConfig(configFile, MapConfig.class);
315+
mapConfig.checkLegacy();
316+
mapConfigs.put(id, mapConfig);
317+
} catch (ConfigurationException ex) {
318+
throw new ConfigurationException("Failed to load map-config:\n" +
319+
configFile.toAbsolutePath().normalize(),
320+
ex);
321+
}
316322
}
317323
} catch (IOException ex) {
318324
throw new ConfigurationException("BlueMap failed to read your map configuration from\n" +

common/src/main/java/de/bluecolored/bluemap/common/config/ConfigurationException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public String getFullExplanation() {
7979
public String getFormattedExplanation() {
8080
String indentedExplanation = " " + getFullExplanation().replace("\n", "\n ");
8181
return "\n" + FORMATTING_BAR +
82-
"\n There is a problem with your BlueMap setup!\n" +
82+
"\n There is a problem with your BlueMap setup!\n\n" +
8383
indentedExplanation +
8484
"\n" + FORMATTING_BAR;
8585
}

0 commit comments

Comments
 (0)