CopilotAuthException
NexusLabs.Needlr.Copilot¶
CopilotAuthException Class¶
Thrown when a Copilot request fails because the caller is not authenticated. This covers two distinct cases:
Inheritance System.Object 🡒 System.Exception 🡒 CopilotAuthException
Remarks¶
-
No token configured locally.NexusLabs.Needlr.Copilot.GitHubOAuthTokenProvider could not resolve a GitHub OAuth token from any configured source (explicit option, apps.json, or environment variables). The HTTP request is never sent.
-
Token rejected by the server.NexusLabs.Needlr.Copilot.CopilotMcpToolClient received an HTTP
401 Unauthorizedor403 Forbiddenresponse from the Copilot MCP endpoint, indicating the supplied token is invalid, expired, or lacks the required scopes.
Callers should catch this exception to implement fallback behavior such as switching to an alternative search provider or surfacing a re-authentication prompt to the user. This is the auth analog of CopilotRateLimitException and exists so consumers do not have to string-match free-text error messages from the upstream server.
Constructors¶
CopilotAuthException(string) Constructor¶
Creates a new CopilotAuthException with the given human-readable message.
Parameters¶
message System.String
A description of the auth failure.
CopilotAuthException(string, Exception) Constructor¶
Creates a new CopilotAuthException wrapping the given inner exception.
Parameters¶
message System.String
A description of the auth failure.
innerException System.Exception
The underlying exception that caused this failure.