def METHOD_NAME(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 'type' in error_message:
            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)