svn commit: r14902 - trunk/src/argouml-app/src/org/argouml/moduleloader/ModuleLoader2.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: tfmorris
Date: 2008-06-11 16:56:08-0700
New Revision: 14902

Modified:
   trunk/src/argouml-app/src/org/argouml/moduleloader/ModuleLoader2.java

Log:
Issue 5089: catch both Errors and Exceptions during module loading and enabling to make more bulletproof

Modified: trunk/src/argouml-app/src/org/argouml/moduleloader/ModuleLoader2.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/moduleloader/ModuleLoader2.java?view=diff&rev=14902&p1=trunk/src/argouml-app/src/org/argouml/moduleloader/ModuleLoader2.java&p2=trunk/src/argouml-app/src/org/argouml/moduleloader/ModuleLoader2.java&r1=14901&r2=14902
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/moduleloader/ModuleLoader2.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/moduleloader/ModuleLoader2.java	2008-06-11 16:56:08-0700
@@ -329,10 +329,10 @@
 		            status.setEnabled();
 		        }
 		    }
-		    // Catch all exceptions including runtime exceptions.
-		    catch (Exception e) {                       
-		        LOG.info("Exception while trying to enable module " 
-		                + module.getName(), e);
+		    // Catch all exceptions and errors, however severe
+		    catch (Throwable e) {                       
+		        LOG.info("Exception or error while trying to "
+                                + "enable module " + module.getName(), e);
 		    }
 		} else if (status.isEnabled() && !status.isSelected()) {
 		    try { 
@@ -341,10 +341,10 @@
 		            status.setDisabled();
 		        }
 		    }
-                    // Catch all exceptions including runtime exceptions.
-		    catch (Exception e) {
-		        LOG.info("Exception while trying to disable module "
-		                + module.getName(), e);
+                    // Catch all exceptions and errors, however severe
+		    catch (Throwable e) {
+		        LOG.info("Exception or error while trying to "
+                                + "disable module " + module.getName(), e);
 		    }
 		}
 	    }
@@ -740,7 +740,7 @@
                     + classname + " - may indicate an obsolete"
                     + " extension module or an unresolved dependency", e);
             return false;
-        } catch (Exception e) {
+        } catch (Throwable e) {
             LOG.error("Unexpected error while loading " + classname, e);
             return false;
         }
@@ -774,7 +774,7 @@
                     + classname + " - may indicate an obsolete"
                     + " extension module or an unresolved dependency", e);
             return false;
-        } catch (Exception e) {
+        } catch (Throwable e) {
             LOG.error("Unexpected error while instantiating " + classname, e);
             return false;
         }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.