Skip to content

Commit 9592c82

Browse files
committed
Modified exceptions
1 parent 55aa6d0 commit 9592c82

File tree

1 file changed

+2
-23
lines changed

1 file changed

+2
-23
lines changed

src/main/java/org/hydev/mcpm/client/database/SuperLocalPluginTracker.java

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,9 @@ private PluginYml readMeta(File jar) {
6666
try (PluginJarFile InstancePluginJarFile = new PluginJarFile(jar)) {
6767
return InstancePluginJarFile.readPluginYaml();
6868
} catch (IOException e) {
69-
System.out.println("Error reading plugin.yml from " + jar);
70-
return null;
69+
throw new RuntimeException("Error reading plugin.yml from " + jar.getAbsolutePath());
7170
} catch (InvalidPluginMetaStructure e) {
72-
System.out.println("Invalid plugin.yml structure in " + jar);
73-
e.printStackTrace();
74-
return null;
71+
throw new RuntimeException("Invalid plugin.yml structure in " + jar.getAbsolutePath());
7572
}
7673
}
7774

@@ -504,7 +501,6 @@ public Boolean compareVersion(String name, SearchPackagesBoundary searchPackages
504501

505502
}
506503
} else {
507-
System.out.println("Error getting hash from server");
508504
return false;
509505
}
510506

@@ -559,21 +555,4 @@ private File getPluginFile(String name) {
559555
return null;
560556
}
561557

562-
/**
563-
* Tests. TODO: Move this to tests
564-
*
565-
* @param args Arguments (not used)
566-
*/
567-
public static void main(String[] args) {
568-
LocalPluginTracker myLocalPluginTracker = new LocalPluginTracker();
569-
570-
// Test listInstalled
571-
List<PluginYml> installedPlugins = myLocalPluginTracker.listInstalled();
572-
for (PluginYml plugin : installedPlugins) {
573-
System.out.println(plugin.name());
574-
}
575-
576-
// Test listOutdated
577-
578-
}
579558
}

0 commit comments

Comments
 (0)