mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +01:00
Remove RuntimExceptions on transient errors
This commit is contained in:
parent
8bed027e4e
commit
f7ec318179
1 changed files with 12 additions and 7 deletions
|
|
@ -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,17 +116,19 @@ 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();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue