Using response.text
@@ -208,14 +208,14 @@ class HeasarcClass(BaseQuery):
if not verbose:
commons.suppress_vo_warnings()
- if "BATCH_RETRIEVAL_MSG ERROR:" in str(response.content):
+ if "BATCH_RETRIEVAL_MSG ERROR:" in response.text:
raise InvalidQueryError("One or more inputs is not recognized by HEASARC. "
"Check that the object name is in GRB, SIMBAD+Sesame, or "
"NED format and that the mission name is as listed in "
"query_mission_list().")
- elif "ERROR" in str(response.content):
- raise InvalidQueryError("Unspecified error from HEASARC database. "
- "\nCheck error message: \n{!s}".format(response.content))
+ elif "ERROR" in response.text:
+ raise InvalidQueryError("unspecified error from HEASARC database. "
+ "\nCheck error message: \n{!s}".format(response.text))
try:
data = BytesIO(response.content)
