Skip to content

🩹 [Patch]: Update error for Assert-GitHubContext with info #468

@MariusStorhaug

Description

@MariusStorhaug

Describe the change

Update the Assert-GitHubContext function with displaying what context type it is when throwing an issue.

Assert-GitHubContext : The context 'dnb.ghe.com/dnb-organization-vending' does not match the required AuthTypes [IAT PAT UAT Anonymous] for [Get-GitHubRateLimit].
  At /home/runner/.local/share/powershell/Modules/GitHub/0.33.8/GitHub.psm1:21660 char:9
  +         Assert-GitHubContext -Context $Context -AuthType IAT, PAT, UA …
  +         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  + CategoryInfo          : InvalidArgument: (dnb.ghe.com/dnb-organization-vending:AppGitHubContext) [Assert-GitHubContext], Exception
  + FullyQualifiedErrorId : InvalidContextAuthType,Assert-GitHubContext

I want this to tell me what kind of AuthType it is. Something like this:

The context 'dnb.ghe.com/dnb-organization-vending' is of type [APP] which does not match the required types [IAT, PAT, UAT, Anonymous] for [Get-GitHubRateLimit].

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions