Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit d9f6e5a

Browse files
committed
Protect against accidental leaking of model responsibilities into the viewmodel
Using Octokit in a view model should not happen - only the model should be using it - but the type leaks in the exception, so just make that a full type reference instead of pulling in the Octokit namespace. Just to avoid being tempted to use it :)
1 parent 75fc407 commit d9f6e5a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/GitHub.App/ViewModels/LoginTabViewModel.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
using GitHub.Validation;
1414
using NLog;
1515
using NullGuard;
16-
using Octokit;
1716
using ReactiveUI;
1817

1918
namespace GitHub.ViewModels
@@ -46,7 +45,7 @@ protected LoginTabViewModel(IRepositoryHosts repositoryHosts, IVisualStudioBrows
4645

4746
log.Info(string.Format(CultureInfo.InvariantCulture, "Error logging into '{0}' as '{1}'", BaseUri,
4847
UsernameOrEmail), ex);
49-
if (ex is ForbiddenException)
48+
if (ex is Octokit.ForbiddenException)
5049
{
5150
ShowLogInFailedError = true;
5251
LoginFailedMessage = "Make sure to use your password and not a Personal Access token to log in.";

0 commit comments

Comments
 (0)