use response.text when expecting text (#39533)
This commit is contained in:
parent
0ecaa0d858
commit
5747367a56
|
@ -1072,7 +1072,7 @@ class AtrealOpenads(BaseResource, HTTPResource, BaseModel):
|
||||||
|
|
||||||
# TODO ask for openADS.API to *always* send JSON formatted errors, not HTML ones
|
# TODO ask for openADS.API to *always* send JSON formatted errors, not HTML ones
|
||||||
# return a string representing the HTTP error (filtering the HTML tags and multispaces)
|
# return a string representing the HTTP error (filtering the HTML tags and multispaces)
|
||||||
detail = clean_spaces(strip_tags(response.content[:1000])) if response.content else ''
|
detail = clean_spaces(strip_tags(response.text[:1000])) if response.text else ''
|
||||||
return u"HTTP error: %s%s" % (response.status_code, ', ' + detail if detail else '')
|
return u"HTTP error: %s%s" % (response.status_code, ', ' + detail if detail else '')
|
||||||
|
|
||||||
@endpoint(
|
@endpoint(
|
||||||
|
|
Reference in New Issue