Print a red `msg` to STDERR and exit.
    To be used in a context of an exception, also prints out the exception.
    The message is formatted with `args` & `kwargs`.
320560
def fatal(msg, *args, **kwargs):
    
    exc_str = format_exc()
    if exc_str.strip() != 'NoneType: None':
        logger.info('{}', format_exc())
    fatal_noexc(msg, *args, **kwargs)
3399
def error(self, message):
        
        self.print_usage(_sys.stderr)
        self.exit(2, _('%s: error: %s\n') % (self.prog, message))
632726
def exit(code=0, text=''):
    
    if not isinstance(text, basestring_type):
        text = unicode_type(text)
    if code > 0:
        if text:
            if not isinstance(text, basestring_type):
                text = unicode_type(text)
            sys.stderr.write(text)
        sys.exit(code)
    else:
        if text:
            print(text)
        sys.exit(0)
91649
def show_error(msg):
    
    sys.stdout.flush()
    sys.stderr.write("\n{0!s}: {1}".format(colored.red("Error"), msg + '\n'))
82097
def error(self, msg):
        '''
        
        '''
        self.print_usage(sys.stderr)
        self.exit(salt.defaults.exitcodes.EX_USAGE, '{0}: error: {1}\n'.format(self.get_prog_name(), msg))
966048
def handle_error(self, exc, msg):
        
        if self.mode == "api":
            logger.error(msg)
            if self.strict:
                raise exc
        elif self.mode == "cli":
            sys.stderr.write(msg)
            sys.exit(1)
64008
def error_log(self, msg='', level=20, traceback=False):
        
        # Override this in subclasses as desired
        sys.stderr.write(msg + '\n')
        sys.stderr.flush()
        if traceback:
            tblines = traceback_.format_exc()
            sys.stderr.write(tblines)
            sys.stderr.flush()
277538
def handle_stderr(stderr_pipe):
    
    stderr_output = stderr_pipe.read()

    if len(stderr_output) > 0:
        click.secho("\n__ Error Output {0}".format('_'*62), fg='white',
                    bold=True)
        click.echo(stderr_output)

    return True
1174704
async function handleError(error) {
    process.stderr.write('\n' + chalk.red.bold(error + '\n\n'));
    await help(args);
    return 1;
}
461561
def print_err(*args, **kwargs):
    
    if kwargs.get('file', None) is None:
        kwargs['file'] = sys.stderr
    print(*args, **kwargs)
568820
def abort(msg=None, exitcode=1):
    
    if msg is not None:
        if exitcode in (None, 0):
            print(msg)
        else:
            print_err(msg)
    sys.exit(exitcode)
404529
def print_err(*args, **kwargs):
    
    sys.stderr.write(" ".join(str(arg) for arg in args) + "\n")
    if kwargs.get("flush", False):
        sys.stderr.flush()
735995
def _print(self, msg, color=None, arrow=False, indent=None):
        
        if color:
            msg = colored(msg, color)

        if arrow:
            msg = colored('===> ', 'blue') + msg

        if indent:
            msg = ('     ' * indent) + msg

        print(msg)

        return msg
1198290
def exception(self, msg=None, *args, **kwargs):
        
        kwargs['exc_info'] = 1
        return self._log(logging.ERROR, msg, args, kwargs)
1079741
def print_warning(msg):
    
    if IS_POSIX:
        print(u"%s[WARN] %s%s" % (ANSI_WARNING, msg, ANSI_END))
    else:
        print(u"[WARN] %s" % (msg))
704834
def graceful_exit(self, msg):
      
      # Print stored errors to stderr
      if self.caught_error:
         self.print2file(self.stderr, False, False, self.caught_error)
      # Kill process with error message
      self.log(msg)
      sys.exit(1)
1333570
def _print_err(*args):
    
    if not CFG.debug:
        return
    if not args:
        return
    encoding = 'utf8' if os.name == 'posix' else 'gbk'
    args = [_cs(a, encoding) for a in args]
    f_back = None
    try:
        raise Exception
    except:
        f_back = sys.exc_traceback.tb_frame.f_back
    f_name = f_back.f_code.co_name
    filename = os.path.basename(f_back.f_code.co_filename)
    m_name = os.path.splitext(filename)[0]
    prefix = ('[%s.%s]'%(m_name, f_name)).ljust(20, ' ')
    print bcolors.FAIL+'[%s]'%str(datetime.datetime.now()), prefix, ' '.join(args) + bcolors.ENDC