File tree 2 files changed +5
-4
lines changed
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:
119
119
client .AuthenticationApi (api_client ).get_api_group ()
120
120
config_path = None
121
121
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 )
125
124
126
125
def logout (self ) -> str :
127
126
"""
Original file line number Diff line number Diff line change @@ -43,7 +43,9 @@ def _kube_api_error_handling(
43
43
print (nf_msg )
44
44
return
45
45
elif e .reason == "Unauthorized" or e .reason == "Forbidden" :
46
- raise PermissionError (perm_msg )
46
+ if print_error :
47
+ print (perm_msg )
48
+ return
47
49
elif e .reason == "Conflict" :
48
50
raise FileExistsError (exists_msg )
49
51
raise e
You can’t perform that action at this time.
0 commit comments