Convenience dispatcher to the error_exit() method.

    Will raise "warning" error, i.e. script processing continues.
6196
def warn( callingClass, astr_key, **kwargs ):
    '''
    
    '''
    kwargs['exitToOS']  = False
    report( callingClass, astr_key, **kwargs )
110665
def exit(status=0):
    
    if status == 0:
        lab.io.printf(lab.io.Colours.GREEN, "Done.")
    else:
        lab.io.printf(lab.io.Colours.RED, "Error {0}".format(status))
    sys.exit(status)
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)
901536
function onError(error) {
    me.terminated = true;
    if (me.terminating && me.terminationHandler) {
      me.terminationHandler(me);
    }
    me.terminating = false;

    for (var id in me.processing) {
      if (me.processing[id] !== undefined) {
        me.processing[id].resolver.reject(error);
      }
    }
    me.processing = Object.create(null);
  }
1172122
def exit(self, result=0, msg=None, *args, **kwargs):
    """"""
    if self._finalizer:
      try:
        self._finalizer()
      except Exception as e:
        try:
          NailgunProtocol.send_stderr(
            self._socket,
            '\nUnexpected exception in finalizer: {!r}\n'.format(e)
          )
        except Exception:
          pass

    try:
      # Write a final message to stderr if present.
      if msg:
        NailgunProtocol.send_stderr(self._socket, msg)

      # Send an Exit chunk with the result.
      NailgunProtocol.send_exit_with_code(self._socket, result)

      # Shutdown the connected socket.
      teardown_socket(self._socket)
    finally:
      super(DaemonExiter, self).exit(result=result, *args, **kwargs)
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)
220624
def stop(self):
                
        if self.is_alive():
            self._proc.terminate()
            
        if self._proc is not None:
            self.__cleanup()
                   
            if self.raise_error:
                if self._proc.exitcode == 255:
                    raise LoopExceptionError("the loop function return non zero exticode ({})!\n".format(self._proc.exitcode)+
                                             "see log (INFO level) for traceback information")
        self.pipe_handler.close()
        self._proc = None
264459
def shell_out_ignore_exitcode(cmd, stderr=STDOUT, cwd=None):
    """"""
    try:
        return shell_out(cmd, stderr=stderr, cwd=cwd)
    except CalledProcessError as c:
        return _clean_output(c.output)
482345
def _exit_handling(self):
        

        def close_asyncio_loop():
            loop = None
            try:
                loop = asyncio.get_event_loop()
            except AttributeError:
                pass
            if loop is not None:
                loop.close()

        atexit.register(close_asyncio_loop)
1035896
function done(err) {
            if (err != null) {
                process.exitCode = 1
                console.error(`  ERROR: ${err.message}`)
            }
            if (options.verbose && err == null) {
                console.log("  Done.")
            }

            next()

            if (callback != null) {
                callback(err)
            }
        }
321433
def error(self):
        
        if self.__timed_out:
            return TimeoutError(self.session, self, "timeout")
        if self.__exit_code is not None and \
                self.__expected_exit_code is not None and \
                self.__exit_code != self.__expected_exit_code:
            return ExitCodeError(self.session, self,
                                 'bad exit code: Got %s' % self.__exit_code)
890702
def Exit(msg, code=1):
    
    print >> sys.stderr, msg
    sys.exit(code)
1190667
def raise_on_failure(mainfunc):
    """"""
    try:
        errors = mainfunc()
        if errors:
            exit(errors)
    except CalledProcessError as error:
        exit(error.returncode)
    except SystemExit as error:
        if error.code:
            raise
    except KeyboardInterrupt:  # I don't plan to test-cover this.  :pragma:nocover:
        exit(1)
1036011
def exitcode(self):
        
        if self._process is None:
            raise ProcessError(
                "Process '%s' has not been started yet" % self.name)
        return self._process.exitcode
463288
def on_terminate(func):
    """"""
    def exit_function(*args):
        func()
        exit(0)
    signal.signal(signal.SIGTERM, exit_function)
1253269
def do_exit(*args):
    '''
        
    '''

    try:
        import java.lang.System

        java.lang.System.exit(1)
    except ImportError:
        if len(args) == 1:
            os._exit(args[0])
        else:
            os._exit(0)
1312677
def processEnded(self, reason):
        
        log_debug("{name} process exited", name=self.name)
        if self.deferred:
            if reason.type == ProcessDone:
                self.deferred.callback(reason.value.exitCode)
            elif reason.type == ProcessTerminated:
                self.deferred.errback(reason)
        return self.deferred