def handle_rest_exception(e, msg):
  parent_ex = e.get_parent_ex()
  reason = None
  if hasattr(parent_ex, 'reason'):
    reason = parent_ex.reason
  if isinstance(reason, socket.error):
    LOG.error(smart_str('Could not connect to sqoop server: %s (%s)' % (reason[0], reason[1])))
    return {
      'status': -1,
      'errors': [(reason[0], reason[1]) % _('Could not connect to sqoop server. %s (%s)')]
    }
  else:
    LOG.error(smart_str(msg))
    LOG.error(smart_str(e.message))
    return {
      'status': 1,
      'errors': [msg],
      'exception': str(e)
    }
dataset/ETHPy150Open cloudera/hue/apps/sqoop/src/sqoop/api/exception.py/handle_rest_exception/swapped operands of `%`