Remove RuntimExceptions on transient errors

This commit is contained in:
YuviPanda 2013-04-02 21:21:50 +05:30
parent 8bed027e4e
commit f7ec318179

View file

@ -50,7 +50,8 @@ public class ModificationsSyncAdapter extends AbstractThreadedSyncAdapter {
} catch (OperationCanceledException e) { } catch (OperationCanceledException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} catch (IOException e) { } catch (IOException e) {
throw new RuntimeException(e); Log.d("Commons", "Could not authenticate :(");
return;
} catch (AuthenticatorException e) { } catch (AuthenticatorException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
@ -63,7 +64,8 @@ public class ModificationsSyncAdapter extends AbstractThreadedSyncAdapter {
try { try {
editToken = api.getEditToken(); editToken = api.getEditToken();
} catch (IOException e) { } catch (IOException e) {
throw new RuntimeException(e); Log.d("Commons", "Can not retreive edit token!");
return;
} }
@ -98,7 +100,8 @@ public class ModificationsSyncAdapter extends AbstractThreadedSyncAdapter {
.param("titles", contrib.getFilename()) .param("titles", contrib.getFilename())
.get(); .get();
} catch (IOException e) { } catch (IOException e) {
throw new RuntimeException(e); Log.d("Commons", "Network fuckup on modifications sync!");
continue;
} }
Log.d("Commons", "Page content is " + Utils.getStringFromDOM(requestResult.getDocument())); Log.d("Commons", "Page content is " + Utils.getStringFromDOM(requestResult.getDocument()));
@ -113,18 +116,20 @@ public class ModificationsSyncAdapter extends AbstractThreadedSyncAdapter {
.param("summary", sequence.getEditSummary()) .param("summary", sequence.getEditSummary())
.post(); .post();
} catch (IOException e) { } catch (IOException e) {
throw new RuntimeException(e); Log.d("Commons", "Network fuckup on modifications sync!");
continue;
} }
Log.d("Commons", "Response is" + Utils.getStringFromDOM(responseResult.getDocument())); Log.d("Commons", "Response is" + Utils.getStringFromDOM(responseResult.getDocument()));
String result = responseResult.getString("/api/edit/@result"); String result = responseResult.getString("/api/edit/@result");
if(!result.equals("Success")) { if(!result.equals("Success")) {
throw new RuntimeException(); // FIXME: Log this somewhere else
} Log.d("Commons", "Non success result!" + result);
} else {
sequence.delete(); sequence.delete();
} }
}
allModifications.moveToNext(); allModifications.moveToNext();
} }