code: def _parse_output_for_errors(data, command, **kwargs):
      '''
      Helper method to parse command output for error information
      '''
      if re.search('% Invalid', data):
          raise CommandExecutionError({
              'rejected_input': command,
              'message': 'CLI excution error',
              'code': '400',
              'cli_error': data.lstrip(),
          })
      if kwargs.get('error_pattern') is not None:
          for re_line in kwargs.get('error_pattern'):
              if re.search(re_line, data):
                  raise CommandExecutionError({
                      'rejected_input': command,
                      'message': 'CLI excution error',
                      'code': '400',
                      'cli_error': data.lstrip(),
                  }f _parse_output_for_errors(data, command, **kwargs):
      '''
      Helper method to parse command output for error information
      '''
      if re.search('% Invalid', data):
          raise CommandExecutionError({
              'rejected_input': command,
              'message': 'CLI excution error',
              'code': '400',
              'cli_error': data.lstrip(),
          })
      if kwargs.get('error_pattern') is not None:
          for re_line in kwargs.get('error_pattern'):
              if re.search(re_line, data):
                  raise CommandExecutionError({
                      'rejected_input': command,
                      'message': 'CLI excution error',
                      'code': '400',
                      'cli_error': data.lstrip(),
                  })
docs: Helper method to parse command output for error information