Skip to content

Commit 77a82e2

Browse files
Bobbins228openshift-merge-robot
authored andcommitted
Updated error handling
1 parent 16d23d7 commit 77a82e2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/codeflare_sdk/cluster/auth.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import abc
2323
from kubernetes import client, config
2424
import os
25+
from ..utils.kube_api_helpers import _kube_api_error_handling
2526

2627
global api_client
2728
api_client = None
@@ -168,12 +169,12 @@ def config_check() -> str:
168169
try:
169170
config.load_kube_config()
170171
except Exception as e: # pragma: no cover
171-
print(e)
172+
_kube_api_error_handling(e)
172173
elif "KUBERNETES_PORT" in os.environ:
173174
try:
174175
config.load_incluster_config()
175176
except Exception as e: # pragma: no cover
176-
print(e)
177+
_kube_api_error_handling(e)
177178
else:
178179
raise PermissionError(
179180
"Action not permitted, have you put in correct/up-to-date auth credentials?"

0 commit comments

Comments
 (0)