Skip to content

StateManager() at module level raises BackendNotFoundError with a message that does not say what to do #331

Description

@allen0099

Problem

Creating StateManager() at module level, the natural place for it, fails when the backend is set in the app's lifespan (the documented place):

BackendNotFoundError: No instance set for proxy BackendProxy

The message does not say what to do (call BackendProxy.set(...) first, or create the manager after the backend is set).

Proposal

  • Resolve the backend lazily on first use rather than in __init__, so module-level construction works.
  • Make the BackendNotFoundError message actionable: name BackendProxy.set(...) and point to the setup docs.

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

    Labels

    developer-experienceSurprising behaviour, missing warnings or unclear errors for library usersenhancementNew feature or requestoauth-stateStateManager: one-time OAuth state tokens

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions