Author: toad
Date: 2007-03-29 22:17:55 +0000 (Thu, 29 Mar 2007)
New Revision: 12436
Modified:
trunk/freenet/src/freenet/client/async/SingleBlockInserter.java
trunk/freenet/src/freenet/client/async/SplitFileInserter.java
Log:
Use InserterException.construct() when dealing with splitfile errors / multiple
errors
Modified: trunk/freenet/src/freenet/client/async/SingleBlockInserter.java
===================================================================
--- trunk/freenet/src/freenet/client/async/SingleBlockInserter.java
2007-03-29 22:05:13 UTC (rev 12435)
+++ trunk/freenet/src/freenet/client/async/SingleBlockInserter.java
2007-03-29 22:17:55 UTC (rev 12436)
@@ -176,10 +176,7 @@
if(logMINOR) Logger.minor(this, "Failed: "+e);
retries++;
if((retries > ctx.maxInsertRetries) && (ctx.maxInsertRetries !=
-1)) {
- if(errors.isOneCodeOnly())
- fail(new
InserterException(errors.getFirstCode()));
- else
- fail(new
InserterException(InserterException.TOO_MANY_RETRIES_IN_BLOCKS, errors,
getURI()));
+ fail(InserterException.construct(errors));
return;
}
getScheduler().register(this);
Modified: trunk/freenet/src/freenet/client/async/SplitFileInserter.java
===================================================================
--- trunk/freenet/src/freenet/client/async/SplitFileInserter.java
2007-03-29 22:05:13 UTC (rev 12435)
+++ trunk/freenet/src/freenet/client/async/SplitFileInserter.java
2007-03-29 22:17:55 UTC (rev 12436)
@@ -424,10 +424,7 @@
if(allSucceeded)
cb.onSuccess(this);
else {
- if(tracker.isFatal(true))
- cb.onFailure(new
InserterException(InserterException.FATAL_ERRORS_IN_BLOCKS, tracker, null),
this);
- else
- cb.onFailure(new
InserterException(InserterException.TOO_MANY_RETRIES_IN_BLOCKS, tracker, null),
this);
+
cb.onFailure(InserterException.construct(tracker), this);
}
} catch (Throwable t) {
// We MUST tell the parent *something*!