def parse_item(self, item):
        """
        :param item: str, json-encoded string
        """
        item = item.decode("utf-8")
        try:
            parsed_item = json.loads(item)
        except __HOLE__:
            parsed_item = None
        else:
            # append here just in case .get bellow fails
            self._parsed_logs.append(parsed_item)

        # make sure the json is a dictionary object
        if isinstance(parsed_item, dict):
            line = parsed_item.get("stream", "")
        else:
            parsed_item = None
            line = item

        for l in line.splitlines():
            l = l.strip()
            if l:
                logger.debug(l)

        self._logs.append(item)
        if parsed_item is not None:
            self._error = parsed_item.get("error", None)
            self._error_detail = parsed_item.get("errorDetail", None)
            if self._error:
                logger.error(item.strip())
dataset/ETHPy150Open projectatomic/atomic-reactor/atomic_reactor/util.py/CommandResult.parse_item