public void SetsTheOutdatedClientVersionFlag()
        {
            var exception = new ClientDeprecatedException(request, response);

            errorHandlingService.TryHandleDeprecationError(Arg.Any <ClientDeprecatedException>()).Returns(true);

            errorsSubject.OnNext(exception);

            errorHandlingService.Received().TryHandleDeprecationError(Arg.Is(exception));
            errorHandlingService.DidNotReceive().TryHandleUnauthorizedError(Arg.Is(exception));
        }
示例#2
0
        private void onError(Exception exception)
        {
            isLoadingSubject.OnNext(false);
            onCompleted();

            if (errorHandlingService.TryHandleDeprecationError(exception))
            {
                return;
            }

            switch (exception)
            {
            case UnauthorizedException forbidden:
                errorMessageSubject.OnNext(Resources.IncorrectEmailOrPassword);
                break;

            case GoogleLoginException googleEx when googleEx.LoginWasCanceled:
                errorMessageSubject.OnNext("");
                break;

            default:
                errorMessageSubject.OnNext(Resources.GenericLoginError);
                break;
            }
        }
示例#3
0
        private void onError(Exception exception)
        {
            isLoadingSubject.OnNext(false);
            onCompleted();

            if (errorHandlingService.TryHandleDeprecationError(exception))
            {
                return;
            }

            switch (exception)
            {
            case UnauthorizedException forbidden:
                errorMessageSubject.OnNext(Resources.IncorrectEmailOrPassword);
                break;

            case GoogleLoginException googleEx when googleEx.LoginWasCanceled:
                errorMessageSubject.OnNext(string.Empty);
                break;

            case EmailIsAlreadyUsedException _:
                errorMessageSubject.OnNext(Resources.EmailIsAlreadyUsedError);
                break;

            default:
                analyticsService.UnknownSignUpFailure.Track(exception.GetType().FullName, exception.Message);
                analyticsService.TrackAnonymized(exception);
                errorMessageSubject.OnNext(Resources.GenericSignUpError);
                break;
            }
        }
示例#4
0
        private void onError(Exception exception)
        {
            IsLoading = false;
            onCompleted();

            if (errorHandlingService.TryHandleDeprecationError(exception))
            {
                return;
            }

            switch (exception)
            {
            case UnauthorizedException forbidden:
                ErrorMessage = Resources.IncorrectEmailOrPassword;
                break;

            case GoogleLoginException googleEx when googleEx.LoginWasCanceled:
                ErrorMessage = "";
                break;

            default:
                ErrorMessage = Resources.GenericLoginError;
                break;
            }
        }
示例#5
0
 private void onError(Exception exception)
 {
     if (!errorHandlingService.TryHandleDeprecationError(exception) &&
         !errorHandlingService.TryHandleUnauthorizedError(exception) &&
         !errorHandlingService.TryHandleNoWorkspaceError(exception) &&
         !errorHandlingService.TryHandleNoDefaultWorkspaceError(exception))
     {
         throw new ArgumentException(
                   $"{nameof(SyncErrorHandlingService)} could not handle unknown sync error {exception.GetType().FullName}.",
                   exception);
     }
 }
        private void onSyncError(Exception exception)
        {
            if (errorHandlingService.TryHandleDeprecationError(exception) ||
                errorHandlingService.TryHandleUnauthorizedError(exception) ||
                errorHandlingService.TryHandleNoWorkspaceError(exception))
            {
                stopSyncingOnSignal();
                return;
            }

            throw new ArgumentException($"{nameof(TogglDataSource)} could not handle unknown sync error {exception.GetType().FullName}.", exception);
        }