@@ -30,8 +30,11 @@ def try_auth(username, password):
3030 credentials = Auth .read_from_disk ()
3131 except FileNotFoundError :
3232 print ("Credentials not found.." , flush = True )
33- update_credentials (username , password )
34- credentials = Auth .read_from_disk ()
33+ try :
34+ update_credentials (username , password )
35+ credentials = Auth .read_from_disk ()
36+ except Exception as e :
37+ return None
3538
3639 auth = Auth ().assign_profile (credentials )
3740
@@ -58,7 +61,11 @@ def init():
5861
5962 while True :
6063 print ("Trying to auth.." , flush = True )
61- credentials = try_auth (args .username , args .password ) # Make sure we can still auth
64+ try :
65+ credentials = try_auth (args .username , args .password ) # Make sure we can still auth
66+ except :
67+ print ("Invalid password or blocked from auth server for reconnecting too fast.." , flush = True )
68+
6269 print ("Finished auth" , flush = True )
6370 if credentials :
6471 print ("Starting.." , flush = True )
@@ -75,7 +82,8 @@ def init():
7582 if not args .username or not args .password :
7683 print ("Can't re-auth user because no user or password provided!" , flush = True )
7784 return
78- time .sleep (3 )
85+ print ("Username or password wrong, waiting 30 seconds before reconnecting.." )
86+ time .sleep (30 )
7987
8088if __name__ == '__main__' :
8189 init ()
0 commit comments