mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-05 10:49:24 +02:00
Server error does not mean synchronization is failed
This commit is contained in:
parent
69f71fccf7
commit
8c51b53ba0
1 changed files with 4 additions and 3 deletions
|
@ -44,6 +44,7 @@ public class SynchroniserService extends Service implements IBookCollection.List
|
||||||
Uploaded(Book.SYNCHRONIZED_LABEL),
|
Uploaded(Book.SYNCHRONIZED_LABEL),
|
||||||
ToBeDeleted(Book.SYNC_DELETED_LABEL),
|
ToBeDeleted(Book.SYNC_DELETED_LABEL),
|
||||||
Failure(Book.SYNC_FAILURE_LABEL),
|
Failure(Book.SYNC_FAILURE_LABEL),
|
||||||
|
ServerError(null),
|
||||||
SyncronizationDisabled(null),
|
SyncronizationDisabled(null),
|
||||||
FailedPreviuousTime(null),
|
FailedPreviuousTime(null),
|
||||||
HashNotComputed(null);
|
HashNotComputed(null);
|
||||||
|
@ -312,7 +313,7 @@ public class SynchroniserService extends Service implements IBookCollection.List
|
||||||
myNetworkContext.perform(verificationRequest);
|
myNetworkContext.perform(verificationRequest);
|
||||||
} catch (ZLNetworkException e) {
|
} catch (ZLNetworkException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
return SyncStatus.Failure;
|
return SyncStatus.ServerError;
|
||||||
}
|
}
|
||||||
final String csrfToken = myNetworkContext.getCookieValue(DOMAIN, "csrftoken");
|
final String csrfToken = myNetworkContext.getCookieValue(DOMAIN, "csrftoken");
|
||||||
try {
|
try {
|
||||||
|
@ -326,7 +327,7 @@ public class SynchroniserService extends Service implements IBookCollection.List
|
||||||
return uploadRequest.Success ? SyncStatus.Uploaded : SyncStatus.Failure;
|
return uploadRequest.Success ? SyncStatus.Uploaded : SyncStatus.Failure;
|
||||||
} catch (ZLNetworkException e) {
|
} catch (ZLNetworkException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
return SyncStatus.Failure;
|
return SyncStatus.ServerError;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
final List<String> hashes = (List<String>)result.get("hashes");
|
final List<String> hashes = (List<String>)result.get("hashes");
|
||||||
|
@ -340,7 +341,7 @@ public class SynchroniserService extends Service implements IBookCollection.List
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
System.err.println("UNEXPECTED RESPONSE: " + result);
|
System.err.println("UNEXPECTED RESPONSE: " + result);
|
||||||
return SyncStatus.Failure;
|
return SyncStatus.ServerError;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue