Skip to content

Commit

Permalink
Updated the error message for unsupported token format
Browse files Browse the repository at this point in the history
  • Loading branch information
ParthaI committed Apr 8, 2024
1 parent 15df827 commit 6f3f86c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions github/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func connect(ctx context.Context, d *plugin.QueryData) *github.Client {

// Return error for unsupported token by prefix
if token != "" && !strings.HasPrefix(token, "ghs_") && !strings.HasPrefix(token, "ghp_") {
panic("Unsupported token format detected, please ensure your token begins with 'ghs_' or 'ghp_' as these are the supported formats")
panic("Supported token formats are 'ghp_' and 'ghp_'")
}

var client *github.Client
Expand Down Expand Up @@ -184,7 +184,7 @@ func connectV4(ctx context.Context, d *plugin.QueryData) *githubv4.Client {

// Return error for unsupported token by prefix
if token != "" && !strings.HasPrefix(token, "ghs_") && !strings.HasPrefix(token, "ghp_") {
panic("Unsupported token format detected, please ensure your token begins with 'ghs_' or 'ghp_' as these are the supported formats")
panic("Supported token formats are 'ghp_' and 'ghp_'")
}

var client *githubv4.Client
Expand Down

0 comments on commit 6f3f86c

Please sign in to comment.