Author: saces
Date: 2009-03-10 14:42:16 +0000 (Tue, 10 Mar 2009)
New Revision: 25977

Modified:
   branches/db4o/freenet/src/freenet/pluginmanager/PluginManager.java
Log:
fix npe, better error handling/reporting

Modified: branches/db4o/freenet/src/freenet/pluginmanager/PluginManager.java
===================================================================
--- branches/db4o/freenet/src/freenet/pluginmanager/PluginManager.java  
2009-03-10 11:44:08 UTC (rev 25976)
+++ branches/db4o/freenet/src/freenet/pluginmanager/PluginManager.java  
2009-03-10 14:42:16 UTC (rev 25977)
@@ -547,9 +547,9 @@
                synchronized(toadletList) {
                        handler = toadletList.get(plugin);
                }
-               /*if (handler == null)
-               return null;
-                */
+               if (handler == null)
+                       throw new NotFoundPluginHTTPException("Plugin 
'"+plugin+"' not found!", "/plugins");
+               
                ClassLoader oldClassLoader = 
Thread.currentThread().getContextClassLoader();
                ClassLoader pluginClassLoader = 
handler.getClass().getClassLoader();
                Thread.currentThread().setContextClassLoader(pluginClassLoader);
@@ -559,7 +559,7 @@
                } finally {
                        
Thread.currentThread().setContextClassLoader(oldClassLoader);
                }
-               throw new NotFoundPluginHTTPException("Plugin not found!", 
"/plugins");
+               throw new NotFoundPluginHTTPException("Plugin '"+plugin+"' not 
found!", "/plugins");
        }
 
        public void killPlugin(String name, int maxWaitTime) {

_______________________________________________
cvs mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs

Reply via email to