Skip to content

Commit 7d4f1b1

Browse files
committed
Read response before raising the exception
One MUST read response before launching a new request. Otherwise it is imposible to get a new response object
1 parent 1806ff7 commit 7d4f1b1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

yarn_api_client/base.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ def request(self, api_path, **query_args):
3838
if response.status == OK:
3939
return self.response_class(response)
4040
else:
41-
msg = 'Response finished with status: %s' % response.status
41+
explanation = response.read()
42+
msg = 'Response finished with status: %s. Details: %s' % (response.status, explanation)
4243
raise APIError(msg)
4344

4445
def construct_parameters(self, arguments):

0 commit comments

Comments
 (0)