提交 b32d0e4f 编写于 作者: N Nicolas De Loof

Use dedicated exceptions to track incompatible/missing plugin

to be used by other component to log/resolve configuration issue.
上级 2d40b7e7
......@@ -501,10 +501,10 @@ public class PluginWrapper implements Comparable<PluginWrapper>, ModelObject {
}
if (!missingDependencies.isEmpty())
throw new IOException("Dependency "+Util.join(missingDependencies, ", ")+" doesn't exist");
throw new MissingDepencyException("Dependency "+Util.join(missingDependencies, ", ")+" doesn't exist", missingDependencies);
if (!incompatibleDependencies.isEmpty())
throw new IOException("Dependency "+Util.join(incompatibleDependencies, ", ")+" doesn't match required version");
throw new IncompatibleDependencyException("Dependency "+Util.join(incompatibleDependencies, ", ")+" doesn't match required version", incompatibleDependencies);
}
......@@ -646,4 +646,21 @@ public class PluginWrapper implements Comparable<PluginWrapper>, ModelObject {
private static final Logger LOGGER = Logger.getLogger(PluginWrapper.class.getName());
public class IncompatibleDependencyException extends IOException {
public final List<String> plugins;
public IncompatibleDependencyException(String message, List<String> plugins) {
super(message);
this.plugins = plugins;
}
}
public class MissingDepencyException extends IOException {
public final List<String> plugins;
public MissingDepencyException(String message, List<String> plugins) {
super(message);
this.plugins = plugins;
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册