File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -119,9 +119,8 @@ def login(self) -> str:
119119 client .AuthenticationApi (api_client ).get_api_group ()
120120 config_path = None
121121 return "Logged into %s" % self .server
122- except client .ApiException : # pragma: no cover
123- api_client = None
124- print ("Authentication Error please provide the correct token + server" )
122+ except client .ApiException as e :
123+ _kube_api_error_handling (e )
125124
126125 def logout (self ) -> str :
127126 """
Original file line number Diff line number Diff line change @@ -43,7 +43,9 @@ def _kube_api_error_handling(
4343 print (nf_msg )
4444 return
4545 elif e .reason == "Unauthorized" or e .reason == "Forbidden" :
46- raise PermissionError (perm_msg )
46+ if print_error :
47+ print (perm_msg )
48+ return
4749 elif e .reason == "Conflict" :
4850 raise FileExistsError (exists_msg )
4951 raise e
You can’t perform that action at this time.
0 commit comments