def log_error(self, error):
        if hasattr(error, 'response') and hasattr(error.response, 'json'):
            try:
                meta = error.response.json()
            except:
                meta = error.response
        else:
            meta = error

        self.logger.debug(
            '[%s] %s' % (self.identifier, meta),
            exc_info=True,
        )
        self.logger.warning(
            '[%s] %s' % (self.identifier, meta),
        )
        self.errors.append(meta)
        self.last_error = meta
Log and append errors to object
dataset/ETHPy150Open dropbox/pynsot/pynsot/models.py/Resource.log_error