Skip to content
This repository has been archived by the owner on May 6, 2020. It is now read-only.

Commit

Permalink
fix(scheduler): show more information when there is a HTTP error in K…
Browse files Browse the repository at this point in the history
…ubernetes (#1041)
  • Loading branch information
helgi committed Sep 10, 2016
1 parent 667ba1f commit 29d51d9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions rootfs/scheduler/exceptions.py
Expand Up @@ -7,10 +7,14 @@ class KubeHTTPException(KubeException):
def __init__(self, response, errmsg, *args, **kwargs):
self.response = response

data = response.json()
message = data['message'] if 'message' in data else ''

msg = errmsg.format(*args)
msg = "failed to {}: {} {}".format(
msg = 'failed to {}: {} {} {}'.format(
msg,
response.status_code,
response.reason
response.reason,
message
)
KubeException.__init__(self, msg, *args, **kwargs)

0 comments on commit 29d51d9

Please sign in to comment.