Author: nextgens
Date: 2007-02-08 22:10:49 +0000 (Thu, 08 Feb 2007)
New Revision: 11695

Modified:
   trunk/freenet/src/freenet/clients/http/QueueToadlet.java
Log:
Add debugging code to trace #948 (emergency remove button not working)

Modified: trunk/freenet/src/freenet/clients/http/QueueToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/QueueToadlet.java    2007-02-08 
18:05:37 UTC (rev 11694)
+++ trunk/freenet/src/freenet/clients/http/QueueToadlet.java    2007-02-08 
22:10:49 UTC (rev 11695)
@@ -121,16 +121,24 @@
                                ClientRequest[] reqs = fcp.getGlobalRequests();
                                if(logMINOR) Logger.minor(this, "Request count: 
"+reqs.length);

+                               StringBuffer failedIdentifiers = new 
StringBuffer();
+                               
                                for(int i=0; i<reqs.length ; i++){
                                        String identifier = 
reqs[i].getIdentifier();
                                        if(logMINOR) Logger.minor(this, 
"Removing "+identifier);
                                        try {
                                                
fcp.removeGlobalRequest(identifier);
                                        } catch (MessageInvalidException e) {
-                                               this.sendErrorPage(ctx, 200, 
"Failed to remove request", "Failed to remove " + identifier + ": " + 
e.getMessage());
+                                               
failedIdentifiers.append(identifier + ' ' + e.getMessage() + ';');
+                                               Logger.error(this, "Failed to 
remove " + identifier + ':' + e.getMessage());
+                                               continue;
                                        }
                                }
-                               writePermanentRedirect(ctx, "Done", "/queue/");
+                               
+                               if(failedIdentifiers.length() > 0)
+                                       this.sendErrorPage(ctx, 200, "Failed to 
remove request", "Failed to remove " + failedIdentifiers);
+                               else
+                                       writePermanentRedirect(ctx, "Done", 
"/queue/");
                                return;
                        }else if(request.isPartSet("download")) {
                                // Queue a download


Reply via email to