builder: properly decode the http response body
What is returned by content.decode() is a binary string and needs to be properly decoded before we use it, especially in the error messages.
This commit is contained in:
parent
807a4937ee
commit
3342f88f3b
1 changed files with 2 additions and 2 deletions
|
|
@ -178,7 +178,7 @@ class Client:
|
|||
res = self.http.post(url, json=cro.as_dict())
|
||||
|
||||
if res.status_code != 201:
|
||||
body = res.content.strip()
|
||||
body = res.content.decode("utf-8").strip()
|
||||
msg = f"Failed to create the compose request: {body}"
|
||||
raise koji.GenericError(msg) from None
|
||||
|
||||
|
|
@ -192,7 +192,7 @@ class Client:
|
|||
res = self.http.get(url)
|
||||
|
||||
if res.status_code != 200:
|
||||
body = res.content.strip()
|
||||
body = res.content.decode("utf-8").strip()
|
||||
msg = f"Failed to get the compose status: {body}"
|
||||
raise koji.GenericError(msg) from None
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue