コード例 #1
0
        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);
        }