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)); }
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); }