def _raise_error(self, status_code, raw_data):
        """ Locate appropriate exception and raise it. """
        error_message = raw_data
        additional_info = None
        try:
            additional_info = json.loads(raw_data)
            error_message = additional_info.get('error', error_message)
            if isinstance(error_message, dict) and error_message in 'type':
                error_message = error_message['type']
        except:
            # we don't care what went wrong
            pass

        raise HTTP_EXCEPTIONS.get(status_code, TransportError)(status_code, error_message, additional_info)
dataset/ETHPy150Open KunihikoKido/sublime-elasticsearch-client/lib/elasticsearch/connection/base.py/Connection._raise_error/swapped operands of `in`