Deal with network errors separately
This commit is contained in:
parent
f83e52f7c7
commit
60a9fd5b73
|
@ -112,10 +112,13 @@ class SyncService {
|
|||
Bus.instance.fire(SyncStatusUpdate(SyncStatus.error,
|
||||
error: StorageLimitExceededError()));
|
||||
} catch (e, s) {
|
||||
final errorCode = e.error?.osError?.errorCode;
|
||||
if (errorCode == 111 || errorCode == 7) {
|
||||
Bus.instance.fire(SyncStatusUpdate(SyncStatus.paused,
|
||||
reason: "waiting for network..."));
|
||||
if (e is DioError) {
|
||||
final errorCode = e.error?.osError?.errorCode;
|
||||
if (errorCode == 111 || errorCode == 7) {
|
||||
Bus.instance.fire(SyncStatusUpdate(SyncStatus.paused,
|
||||
reason: "waiting for network..."));
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
_logger.severe("backup failed", e, s);
|
||||
Bus.instance
|
||||
|
|
Loading…
Reference in a new issue