docs: async def _raise_for_status(response):
      """Raise an appropriate error for a given response.
  
      Arguments:
        response (:py:class:`aiohttp.ClientResponse`): The API response.
  
      Raises:
        :py:class:`aiohttp.web_exceptions.HTTPException`: The appropriate
          error for the response's status.
  
      This function was taken from the aslack project and modified. The original
      copyright notice:
  
      Copyright (c) 2015, Jonathan Sharpe
  
      Permission to use, copy, modify, and/or distribute this software for any
      purpose with or without fee is hereby granted, provided that the above
      copyright notice and this permission notice appear in all copies.
  
      THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
      WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
      MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
      ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
      WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
      ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
      OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
      """
  
      try:
          response.raise_for_status()
      except aiohttp.ClientResponseError as exc:
          reason = response.reason
  
          spacetrack_error_msg = None
  
          try:
              json = await response.json()
              if isinstance(json, Mapping):
                  spacetrack_error_msg = json['error']
          except (ValueError, KeyError, aiohttp.ClientResponseError):
              pass
  
          if not spacetrack_error_msg:
              spacetrack_error_msg = await response.text()
  
          if spacetrack_error_msg:
              reason += '\nSpace-Track response:\n' + spacetrack_error_msg
  
          payload = dict(
              code=response.status,
              message=reason,
              headers=response.headers,
          )
  
          # history attribute is only aiohttp >= 2.1
          try:
              payload['history'] = exc.history
          except AttributeError:
              pass
  
          raise aiohttp.ClientResponseError(**payload)