# Buggy code
def _parse_result(self, response, verbose=False):
    # if verbose is False then suppress any VOTable related warnings
    if not verbose:
        commons.suppress_vo_warnings()

    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 response.text:
        raise InvalidQueryError(
            "unspecified error from HEASARC database. "
            "\nCheck error message: \n{!s}".format(response.text)
        )

    try:
        data = BytesIO(response.content)
        table = Table.read(data, hdu=1)
        return table
    except ValueError:
        return self._fallback(response.content)


# Traceback (InvalidQueryError)
heasarc = Heasarc()
mission = 'first'
coords = SkyCoord('12h29m06.70s +32d03m08.7s', frame='icrs')
table = heasarc.query_region(coords, mission=mission, radius='1 degree')
---------------------------------------------------------------------------
InvalidQueryError                         Traceback (most recent call last)
<ipython-input-5-92e6d8c3137b> in <module>
2 mission = 'first'
3 coords = SkyCoord('12h29m06.70s +32d03m08.7s', frame='icrs')
----> 4 table = heasarc.query_region(coords, mission=mission, radius='1 degree')

~/anaconda/envs/py36/lib/python3.6/site-packages/astroquery/utils/class_or_instance.py in f(*args, **kwds)
23         def f(*args, **kwds):
24             if obj is not None:
---> 25                 return self.fn(obj, *args, **kwds)
26             else:
27                 return self.fn(cls, *args, **kwds)

~/anaconda/envs/py36/lib/python3.6/site-packages/astroquery/utils/process_asyncs.py in newmethod(self, *args, **kwargs)
27             if kwargs.get('get_query_payload') or kwargs.get('field_help'):
28                 return response
---> 29             result = self._parse_result(response, verbose=verbose)
30             self.table = result
31             return result

~/anaconda/envs/py36/lib/python3.6/site-packages/astroquery/heasarc/core.py in _parse_result(self, response, verbose)
216         elif "ERROR" in response.text:
217             raise InvalidQueryError("unspecified error from HEASARC database. "
--> 218                                     "\nCheck error message: \n{!s}".format(response.text))
219
220         try:

InvalidQueryError: unspecified error from HEASARC database.
Check error message:
SIMPLE  =                    T / BROWSE (FITSDISPLAY V0.1)                      BITPIX  =                    8                                                  NAXIS   =                    0 / DUMMY HDU                                      EXTEND  =                    T / EXTENSIONS ALLOWED                             END
...
(FITS header and table with query results)

# Fixed code
def _parse_result(self, response, verbose=False):
    # if verbose is False then suppress any VOTable related warnings
    if not verbose:
        commons.suppress_vo_warnings()

    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 "Software error:" in response.text:
        raise InvalidQueryError(
            "Unspecified error from HEASARC database. "
            "\nCheck error message: \n{!s}".format(response.text)
        )

    try:
        data = BytesIO(response.content)
        table = Table.read(data, hdu=1)
        return table
    except ValueError:
        return self._fallback(response.content)