On Saturday 16 August 2008 20:21, saces at freenetproject.org wrote: > Author: saces > Date: 2008-08-16 19:21:11 +0000 (Sat, 16 Aug 2008) > New Revision: 21937 > > Modified: > trunk/apps/WoT/src/plugins/WoT/IdentityFetcher.java > Log: > may better onFailure handling, comments > > Modified: trunk/apps/WoT/src/plugins/WoT/IdentityFetcher.java > =================================================================== > --- trunk/apps/WoT/src/plugins/WoT/IdentityFetcher.java 2008-08-16 > 18:57:15 UTC (rev 21936) > +++ trunk/apps/WoT/src/plugins/WoT/IdentityFetcher.java 2008-08-16 > 19:21:11 UTC (rev 21937) > @@ -17,6 +17,7 @@ > import freenet.client.async.ClientCallback; > import freenet.client.async.ClientGetter; > import freenet.keys.FreenetURI; > +import freenet.support.Logger; > > /** > * @author Julien Cornuwel (batosai at freenetproject.org) > @@ -45,20 +46,26 @@ > FetchContext fetchContext = client.getFetchContext(); > fetchContext.maxSplitfileBlockRetries = -1; // retry forever > fetchContext.maxNonSplitfileRetries = -1; // retry forever > - client.fetch(uri, -1, this, this, fetchContext); > + ClientGetter request = client.fetch(uri, -1, this, this, > fetchContext); > + // addRequestToList(request); > } > > @Override > public void onFailure(FetchException e, ClientGetter state) { > > - if(e.newURI != null) { // Handle redirection to a new edition > + if ((e.mode == FetchException.PERMANENT_REDIRECT) || (e.mode == FetchException.PERMANENT_REDIRECT )) {
Duhhhh? :) > + // restart the request > try { > - fetch(e.newURI); > + state.restart(e.newURI); > + // Done. bye. > + return; > } catch (FetchException e1) { > - // TODO Log this properly > - e1.printStackTrace(); > + Logger.error(this, "Request restart failed: > "+e1, e1); > } > } > + // Errors we can't/want deal with > + Logger.error(this, "Fetch failed for "+ state.getURI(), e); > + // removeRequestFromList(state); > } > > @Override -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available URL: <https://emu.freenetproject.org/pipermail/devl/attachments/20080822/b36ea2e2/attachment.pgp>