Skip to content

Commit

Permalink
McDeob - better error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaneBeee committed Sep 30, 2024
1 parent 6a4d638 commit 70c97af
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/main/java/com/shanebeestudios/mcdeob/McDeob.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,13 @@ public static void main(String[] args) {

if (!options.has("version")) {
Logger.error("No version specified, shutting down...");
Logger.warn("See '-versions' for available versions");
System.exit(1);
}

if (!options.has("type")) {
Logger.error("No type specified, shutting down...");
Logger.warn("Please use '-type' and 'server' or 'client'.");
System.exit(1);
}

Expand All @@ -77,14 +79,16 @@ public static void main(String[] args) {
try {
type = Version.Type.valueOf(typeString.toUpperCase());
} catch (IllegalArgumentException e) {
Logger.error("Invalid type specified, shutting down...");
Logger.error("Invalid type specified: '%s'", typeString);
Logger.warn("Please use '-type' and 'server' or 'client'.");
System.exit(1);
return;
}

Version version = Version.getByVersion(versionString);
if (version == null) {
Logger.error("Invalid or unsupported version was specified, shutting down...");
Logger.error("Invalid or unsupported version was specified: '%s'", versionString);
Logger.warn("See '-versions' for available versions");
System.exit(1);
}
version.setType(type);
Expand Down

0 comments on commit 70c97af

Please sign in to comment.