Config: throw correct exception

This commit is contained in:
Bixilon 2020-12-16 21:27:55 +01:00
parent a1e7c8cbf7
commit 1b93449347
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4

View File

@ -233,7 +233,7 @@ public class Configuration {
case CLIENT_TOKEN -> json.getAsJsonObject("accounts").get("client-token").getAsString();
};
}
throw new RuntimeException();
throw new IllegalArgumentException();
}
private void saveData(JsonObject input, ConfigurationPaths.ConfigurationPath path, Object data) {
@ -258,6 +258,8 @@ public class Configuration {
case RESOURCES_URL -> input.getAsJsonObject("download").getAsJsonObject("urls").addProperty("resources", string);
case CLIENT_TOKEN -> input.getAsJsonObject("accounts").addProperty("client-token", string);
}
} else {
throw new IllegalArgumentException();
}
}
}