public void SetsTheUnauthorizedAccessFlag()
        {
            var exception = new UnauthorizedException(request, response);

            errorHandlingService.TryHandleUnauthorizedError(Arg.Any <UnauthorizedException>()).Returns(true);

            errorsSubject.OnNext(exception);

            errorHandlingService.Received().TryHandleUnauthorizedError(Arg.Is(exception));
        }
예제 #2
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);
     }
 }
예제 #3
0
        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);
        }