code: def _raise_for_status(response):
      
      message = ''
      if 400 <= response.status < 500:
          message = '%s Client Error: %s' % (response.status, response.reason)
      elif 500 <= response.status < 600:
          message = '%s Server Error: %s' % (response.status, response.reason)
      else:
          return
      if response.status == 503:
          raise ConnectionError(message)
      if response.headers.get("content-type", "").startswith("application/json"):
          data = json.loads(response.data.decode('utf-8'))
          error = data.get('error', {})
          error_trace = data.get('error_trace', None)
          if "results" in data:
              errors = [res["error_message"] for res in data["results"]
                        if res.get("error_message")]
              if errors:
                  raise ProgrammingError("\n".join(errors))
          if isinstance(error, dict):
              raise ProgrammingError(error.get('message', ''),
                                     error_trace=error_trace)
          raise ProgrammingError(error, error_trace=error_trace)
      raise ProgrammingError(message)
docs: make sure that only crate.exceptions are raised that are defined in
      the DB-API specification