@staticmethod
def check_mode(mode):
    """
        Verify if the requested protocol mode is known.
        """
    if mode not in ('json', 'text'):
        raise ValueError('invalid mode %s' % mode)
    return True
