Skip to content

Implement AuthenticationError #16

Description

@codebestia

Description

Raised when the API key is missing, malformed, or rejected by the server (HTTP 401). Should tell the developer exactly what is wrong: missing key, wrong key format, or key revoked.

Proposed Steps

  • Define AuthenticationError(ShadeError) in errors.py.
  • Carry an optional hint field with corrective guidance (e.g. "Check that you're using a secret key, not a public key").
  • The HTTP client raises this on 401 responses.
  • Config validation also raises this before any network call.

Acceptance Criteria

  • A 401 API response raises AuthenticationError.
  • error.hint contains actionable guidance.
  • Raised immediately when shade.api_key is None and a resource method is called.
  • Subclasses ShadeError.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions