Skip to content

Commit

Permalink
Dont explode if unable to connect to server when logging out
Browse files Browse the repository at this point in the history
  • Loading branch information
justin-russell committed Apr 23, 2024
1 parent e52348a commit e309f0d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion fractal/cli/controllers/auth.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import functools
import os
import sys
from hashlib import sha256
from sys import exit
from typing import Any, Callable, Optional, Tuple
Expand Down Expand Up @@ -111,7 +112,10 @@ async def _logout():

if os.path.exists(path):
os.remove(path)
async_to_sync(_logout)()
try:
async_to_sync(_logout)()
except Exception as e:
print(f"Failed to clear session from matrix server: {e}", file=sys.stderr)
print("Successfully logged out. Have a nice day.")

logout.clicz_aliases = ["logout"]
Expand Down

0 comments on commit e309f0d

Please sign in to comment.