MCPcopy Index your code
hub / github.com/kubernetes-client/python / ApiException

Class ApiException

kubernetes/client/exceptions.py:103–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101
102
103class ApiException(OpenApiException):
104
105 def __init__(self, status=None, reason=None, http_resp=None):
106 if http_resp:
107 self.status = http_resp.status
108 self.reason = http_resp.reason
109 self.body = http_resp.data
110 self.headers = http_resp.getheaders()
111 else:
112 self.status = status
113 self.reason = reason
114 self.body = None
115 self.headers = None
116
117 def __str__(self):
118 """Custom error messages for exception"""
119 error_message = "({0})\n"\
120 "Reason: {1}\n".format(self.status, self.reason)
121 if self.headers:
122 error_message += "HTTP response headers: {0}\n".format(
123 self.headers)
124
125 if self.body:
126 error_message += "HTTP response body: {0}\n".format(self.body)
127
128 return error_message
129
130
131class NotFoundException(ApiException):

Callers 5

requestMethod · 0.90
fake_streamMethod · 0.90
always_failsMethod · 0.90
websocket_callFunction · 0.50
portforward_callFunction · 0.50

Calls

no outgoing calls

Tested by 2

fake_streamMethod · 0.72
always_failsMethod · 0.72