Skip to content

Implement AuthenticationError #16

@codebestia

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions