realm.addURL(url);
}
return realm;
- } catch (Exception e) {
- throw new SonarException(e);
+ } catch (Throwable e) {
+ throw new SonarException("Fail to build the classloader of " + plugin.getKey(), e);
}
}
base.addURL(file.toURI().toURL());
}
return true;
- } catch (Exception e) {
- throw new SonarException(e);
+ } catch (Throwable e) {
+ throw new SonarException("Fail to extend the plugin " + plugin.getBasePlugin() + " for " + plugin.getKey(), e);
}
}
Class claz = get(metadata.getKey()).loadClass(metadata.getMainClass());
return (Plugin) claz.newInstance();
- } catch (Exception e) {
+ } catch (Throwable e) {
+ // Do not catch only Exception in order to detect the plugins compiled for Java > 5
+ // (it raises a java.lang.UnsupportedClassVersionError)
throw new SonarException("Fail to load plugin " + metadata.getKey(), e);
}
}