1+ import logging
12from typing import TYPE_CHECKING , cast
23
34from textual import work
1516from .dashboard import DashboardScreen
1617from .quit_confirm import QuitConfirmScreen
1718
19+ logger = logging .getLogger (__name__ )
20+
1821
1922class LoadingScreen (Screen ):
2023 def __init__ (self , token : str , ** kwargs ) -> None :
@@ -58,7 +61,7 @@ def check_quit(quit_app: bool | None) -> None:
5861 @work (thread = True , exclusive = True )
5962 def authenticate_and_clone (self ) -> None :
6063 try :
61- _ , original_repo = get_repo (self .token )
64+ _token , original_repo = get_repo (self .token )
6265 repo_path , forked_repo = fork_repo (self .token , original_repo )
6366
6467 app = cast ("MemberApp" , self .app )
@@ -69,8 +72,12 @@ def authenticate_and_clone(self) -> None:
6972 app .token = self .token
7073
7174 self .app .call_from_thread (self .show_success )
72- except Exception as e :
73- error_message = str (e )
75+ except Exception :
76+ logger .error ("Error during authentication and cloning" , exc_info = True )
77+ error_message = _ (
78+ "An unexpected error occurred while loading. "
79+ "Please try again or contact support."
80+ )
7481 self .app .call_from_thread (self .show_error , error_message )
7582
7683 def show_success (self ) -> None :
0 commit comments