Beispiel #1
0
        private void processError(Exception error)
        {
            analyticsService.TrackAnonymized(error);
            analyticsService.SyncFailed.Track(error.GetType().FullName, error.Message, error.StackTrace);

            queue.Clear();
            orchestrator.Start(Sleep);

            if (error is NoWorkspaceException ||
                error is NoDefaultWorkspaceException)
            {
                errors.OnNext(error);
                progress.OnNext(SyncProgress.Synced);
                return;
            }

            if (error is OfflineException)
            {
                progress.OnNext(SyncProgress.OfflineModeDetected);
                analyticsService.OfflineModeDetected.Track();
            }
            else
            {
                progress.OnNext(SyncProgress.Failed);
            }

            if (error is ClientDeprecatedException ||
                error is ApiDeprecatedException ||
                error is UnauthorizedException)
            {
                Freeze();
                errors.OnNext(error);
                progress.OnNext(SyncProgress.Failed);
            }
        }
Beispiel #2
0
        private void processError(Exception error)
        {
            queue.Clear();
            orchestrator.Start(Sleep);

            if (error is NoWorkspaceException)
            {
                progress.OnError(error);
                return;
            }

            if (error is OfflineException)
            {
                progress.OnNext(SyncProgress.OfflineModeDetected);
                analyticsService.OfflineModeDetected.Track();
            }
            else
            {
                progress.OnNext(SyncProgress.Failed);
                analyticsService.Track(error);
            }

            if (error is ClientDeprecatedException ||
                error is ApiDeprecatedException ||
                error is UnauthorizedException)
            {
                Freeze();
                progress.OnError(error);
            }
        }
        private void startSyncIfNeeded()
        {
            if (IsRunningSync)
            {
                return;
            }

            var state = queue.Dequeue();

            IsRunningSync = state != Sleep;
            orchestrator.Start(state);
        }
Beispiel #4
0
        private void processError(Exception error)
        {
            queue.Clear();
            orchestrator.Start(Sleep);

            if (error is OfflineException)
            {
                progress.OnNext(SyncProgress.OfflineModeDetected);
            }
            else
            {
                progress.OnNext(SyncProgress.Failed);
            }

            if (error is ClientDeprecatedException ||
                error is ApiDeprecatedException ||
                error is UnauthorizedException)
            {
                progress.OnError(error);
                Freeze();
            }
        }