mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-10-28 12:05:19 +00:00
Use dedicated exceptions to track incompatible/missing plugin
to be used by other component to log/resolve configuration issue.
This commit is contained in:
1 parent
2d40b7e7e9
commit
b32d0e4f74
1 file changed
+19
-2
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user