Author: toad
Date: 2009-02-24 20:00:59 +0000 (Tue, 24 Feb 2009)
New Revision: 25792

Modified:
   branches/db4o/freenet/src/freenet/client/async/SplitFileInserterSegment.java
Log:
Fail insert immediately on an internal or unrecognised error


Modified: 
branches/db4o/freenet/src/freenet/client/async/SplitFileInserterSegment.java
===================================================================
--- 
branches/db4o/freenet/src/freenet/client/async/SplitFileInserterSegment.java    
    2009-02-24 19:20:15 UTC (rev 25791)
+++ 
branches/db4o/freenet/src/freenet/client/async/SplitFileInserterSegment.java    
    2009-02-24 20:00:59 UTC (rev 25792)
@@ -836,6 +836,7 @@
                        finished = true;
                        Logger.error(this, "Insert segment failed: "+e+" for 
"+this, e);
                        this.toThrow = e;
+                       if(persistent) container.store(this);
                }
                cancelInner(container, context);
        }
@@ -974,8 +975,9 @@
                        fail(new 
InsertException(InsertException.INTERNAL_ERROR, "Collision on a CHK", null), 
container, context);
                        return;
                case LowLevelPutException.INTERNAL_ERROR:
-                       errors.inc(InsertException.INTERNAL_ERROR);
-                       break;
+                       Logger.error(this, "Internal error: "+e, e);
+                       fail(new 
InsertException(InsertException.INTERNAL_ERROR, e.toString(), null), container, 
context);
+                       return;
                case LowLevelPutException.REJECTED_OVERLOAD:
                        errors.inc(InsertException.REJECTED_OVERLOAD);
                        break;
@@ -987,7 +989,8 @@
                        break;
                default:
                        Logger.error(this, "Unknown LowLevelPutException code: 
"+e.code);
-                       errors.inc(InsertException.INTERNAL_ERROR);
+                       fail(new 
InsertException(InsertException.INTERNAL_ERROR, e.toString(), null), container, 
context);
+                       return;
                }
                if(persistent)
                        container.store(errors);

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

Reply via email to