Skip to content

Exceptions


LoginRequiredError

Raised when a login-gated feature is attempted without an active session. Catch this to detect missing login and prompt the user to run setup().

from hermex import Gemini, LoginRequiredError

gemini = Gemini()
gemini.open_url()

try:
    response = gemini.query("Describe this image.", attachments=["photo.jpg"])
except LoginRequiredError:
    print("Please run Gemini.setup() and log in first.")

hermex.exceptions.LoginRequiredError

Bases: Exception

Raised when a login-gated feature is used without an active session.

Run Gemini.setup() to log in and save a persistent session.