Author: toad
Date: 2007-02-10 00:58:34 +0000 (Sat, 10 Feb 2007)
New Revision: 11733
Modified:
trunk/freenet/src/freenet/client/async/SplitFileFetcherSegment.java
trunk/freenet/src/freenet/keys/ClientCHK.java
Log:
Better error message: indicate when a CHK appears to be a 0.5 key.
Modified: trunk/freenet/src/freenet/client/async/SplitFileFetcherSegment.java
===================================================================
--- trunk/freenet/src/freenet/client/async/SplitFileFetcherSegment.java
2007-02-10 00:46:42 UTC (rev 11732)
+++ trunk/freenet/src/freenet/client/async/SplitFileFetcherSegment.java
2007-02-10 00:58:34 UTC (rev 11733)
@@ -403,10 +403,10 @@
checkBlockStatus[i].schedule();
} catch (MalformedURLException e) {
// Invalidates the whole splitfile
- fail(new FetchException(FetchException.INVALID_URI,
"Invalid URI in splitfile"));
+ fail(new FetchException(FetchException.INVALID_URI,
"Invalid URI in splitfile: "+e));
} catch (Throwable t) {
Logger.error(this, "Caught "+t+" scheduling "+this, t);
- fail(new FetchException(FetchException.INVALID_URI, t));
+ fail(new FetchException(FetchException.INTERNAL_ERROR,
t));
}
}
Modified: trunk/freenet/src/freenet/keys/ClientCHK.java
===================================================================
--- trunk/freenet/src/freenet/keys/ClientCHK.java 2007-02-10 00:46:42 UTC
(rev 11732)
+++ trunk/freenet/src/freenet/keys/ClientCHK.java 2007-02-10 00:58:34 UTC
(rev 11733)
@@ -67,7 +67,7 @@
cryptoKey = uri.getCryptoKey();
byte[] extra = uri.getExtra();
if((extra == null) || (extra.length < 5))
- throw new MalformedURLException();
+ throw new MalformedURLException("No extra bytes in CHK - maybe a
0.5 key?");
// byte 0 is reserved, for now
cryptoAlgorithm = extra[1];
if((!(cryptoAlgorithm == Key.ALGO_AES_PCFB_256_SHA256 ||