Skip to content

Commit 29d51d9

Browse files
authored
fix(scheduler): show more information when there is a HTTP error in Kubernetes (#1041)
1 parent 667ba1f commit 29d51d9

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

rootfs/scheduler/exceptions.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,14 @@ class KubeHTTPException(KubeException):
77
def __init__(self, response, errmsg, *args, **kwargs):
88
self.response = response
99

10+
data = response.json()
11+
message = data['message'] if 'message' in data else ''
12+
1013
msg = errmsg.format(*args)
11-
msg = "failed to {}: {} {}".format(
14+
msg = 'failed to {}: {} {} {}'.format(
1215
msg,
1316
response.status_code,
14-
response.reason
17+
response.reason,
18+
message
1519
)
1620
KubeException.__init__(self, msg, *args, **kwargs)

0 commit comments

Comments
 (0)