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

Commit f0f2fb2

Browse files
author
Steven Kirk
committed
Tweak incorrect API scopes exception message.
The previous message wasn't very useful as it would only be displayed when a user was logging in with a token, in which case signing out and back in _wouldn't_ fix the problem.
1 parent 7cfc202 commit f0f2fb2

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/GitHub.Api/IncorrectScopesException.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
namespace GitHub.Api
55
{
66
/// <summary>
7-
/// Thrown when the login for a user does not have the required scopes.
7+
/// Thrown when the login for a user does not have the required API scopes.
88
/// </summary>
99
[Serializable]
1010
public class IncorrectScopesException : Exception
1111
{
1212
public IncorrectScopesException()
13-
: this("You need to sign out and back in.")
13+
: this("Incorrect API scopes.")
1414
{
1515
}
1616

src/GitHub.Api/LoginManager.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,8 @@ async Task<User> GetUserAndCheckScopes(IGitHubClient client)
356356
log.Error("Error reading scopes: /user succeeded but scopes header was not present");
357357
}
358358

359-
throw new IncorrectScopesException();
359+
throw new IncorrectScopesException(
360+
"Incorrect API scopes. Required: " + string.Join(",", scopes));
360361
}
361362

362363
Uri GetLoginUrl(IOauthClient client, string state)

0 commit comments

Comments
 (0)