paulazomig commented on code in PR #6348:
URL: https://github.com/apache/cloudstack/pull/6348#discussion_r865124170


##########
agent/src/main/java/com/cloud/agent/AgentShell.java:
##########
@@ -437,25 +436,14 @@ private void launchAgentFromClassInfo(String 
resourceClassNames) throws Configur
             Class<?> impl;
             try {
                 impl = Class.forName(name);
-                final Constructor<?> constructor = 
impl.getDeclaredConstructor();
+                Constructor<?> constructor = impl.getDeclaredConstructor();
                 constructor.setAccessible(true);
                 ServerResource resource = 
(ServerResource)constructor.newInstance();
                 launchNewAgent(resource);
-            } catch (final ClassNotFoundException e) {
-                throw new ConfigurationException("Resource class not found: " 
+ name + " due to: " + e.toString());
-            } catch (final SecurityException e) {
-                throw new ConfigurationException("Security exception when 
loading resource: " + name + " due to: " + e.toString());
-            } catch (final NoSuchMethodException e) {
-                throw new ConfigurationException("Method not found exception 
when loading resource: " + name + " due to: " + e.toString());
-            } catch (final IllegalArgumentException e) {
-                throw new ConfigurationException("Illegal argument exception 
when loading resource: " + name + " due to: " + e.toString());
-            } catch (final InstantiationException e) {
-                throw new ConfigurationException("Instantiation exception when 
loading resource: " + name + " due to: " + e.toString());
-            } catch (final IllegalAccessException e) {
-                throw new ConfigurationException("Illegal access exception 
when loading resource: " + name + " due to: " + e.toString());
-            } catch (final InvocationTargetException e) {
-                throw new ConfigurationException("Invocation target exception 
when loading resource: " + name + " due to: " + e.toString());
-            }
+            } catch (final Exception e) {

Review Comment:
   @DaanHoogland done!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to