From 0d3b274aaa4e1cd79e215a364bde6336ca7ca787 Mon Sep 17 00:00:00 2001 From: Christophe Vila Date: Fri, 22 May 2026 22:35:25 +0200 Subject: [PATCH] fix: verify token on --auth and broaden startup exception catch --- server.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server.py b/server.py index a00fa03..324ba2b 100644 --- a/server.py +++ b/server.py @@ -162,13 +162,14 @@ async def _run_server() -> None: if __name__ == "__main__": if "--auth" in sys.argv: print("Authenticating with Spotify (a browser window will open)...") - spotify_client.get_client() + sp = spotify_client.get_client() + sp.current_user() # verify the token actually works print("Authentication successful! Token cached.") sys.exit(0) try: spotify_client.get_client() - except RuntimeError as e: + except Exception as e: print(f"Startup error: {e}", file=sys.stderr) sys.exit(1)