Skip to content

Commit

Permalink
Add error message when the config file is not valid
Browse files Browse the repository at this point in the history
  • Loading branch information
theoforger committed Oct 3, 2024
1 parent 18c3316 commit e027326
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main/java/org/example/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@ public class Config {
.builder(conigFile)
.sync();
config = builder.build();
config.load();

try {
config.load();
} catch (Exception e) {
throw new RuntimeException("Config file is not valid.");
}

if (config.isEmpty())
load_default();
Expand Down

0 comments on commit e027326

Please sign in to comment.