Creates a fatal error and exit
967333
def panic(self, *args):
        
        self._err("fatal", *args)
        if self.test_errs_mode is False:  # pragma: no cover
            sys.exit(1)
362574
function _trigger_fatal_error($error_msg, $tpl_file = null, $tpl_line = null,
	$file = null, $line = null, $error_type = E_USER_ERROR)
	{
		if(isset($file) && isset($line)) {
			$info = ' ('.basename($file).", line $line)";
		} else {
			$info = '';
		}
		if (isset($tpl_line) && isset($tpl_file)) {
			$this->trigger_error('[in ' . $tpl_file . ' line ' . $tpl_line . "]: $error_msg$info", $error_type);
		} else {
			$this->trigger_error($error_msg . $info, $error_type);
		}
	}
32061
function (error) {
        if (!this.started) {
            return;
        }

        var errorHandlers = this.errorHandlers,
            length = errorHandlers.length,
            errorHandler,
            errorHandled = false,
            errorString,
            i;

        //Exit handling
        if (error instanceof SystemExit) {
            this._exit(error.code);
            return;
        }

        try {
            for (i = 0; i < length; i += 1) {
                errorHandler = errorHandlers[i];
                errorHandled = !!errorHandler(error);

                if (errorHandled) {
                    return;
                }
            }
        } catch (e) {
            this._printError(e);
            this._exit(1);
        }

        //Default error handling
        errorString = '' + (error.stack || error);
        this._printError(errorString);
        this._exit(1);
    }
1145686
function ConfigError(lineno, line, file, err) {
  this.name = ConfigError.name;
  Error.call(this);

  var fmt = '*** FATAL CONFIG FILE ERROR ***%s';
  fmt += 'Reading the configuration file, at line %s%s';
  fmt += '>>> %s%s';
  fmt += err && err.message && !(err instanceof TypeDefError) ? err.message :
    'Bad directive or wrong number of arguments';

  this.message = util.format(fmt, EOL, lineno, EOL, line, EOL);
  this.file = file;
  this.err = err;
}
980723
public static function fatalErrorHandler() {
				
		// get fatal error array
		$error = error_get_last();

		if (!is_null($error)) {

			// command line log has date and plain text
			if ('cli' == php_sapi_name()) {
				
				print date(DATE_RFC2822) . "\nFatal error (" . $error['type'] . ') on file ' .
					$error['file'] . ' line ' . $error['line'] . ': ' . $error['message'] . "\n";

			// format for an HTML web print
			} else {

				print '<div style="background-color:#f1f1f1;border:2px solid red;margin:10px 0;padding:12px 16px">' .
						PRODUCT_NAME . ' fatal error: ' . $error['message'] . '</div>';

			}
		
			// get admin emails by options
			$emails = array_filter(explode(',', Options::get('admin_emails')));
			
			if (count($emails)) {

				// get proper server description
				if (isset($_SERVER['SERVER_NAME'])) {
					$server = $_SERVER['SERVER_NAME'];
				} else if (isset($_SERVER['SERVER_ADDR'])) {
					$server = $_SERVER['SERVER_ADDR'];
				} else {
					$server = '[Unknown]';
				}
			
				// build email parameters
				$subject = PRODUCT_NAME . ' fatal error on ' . $server;
				$message = PRODUCT_NAME . ' generated a fatal error on server ' .  BASE_HREF . ' as of ' .
					date(DATE_RFC2822) . " UTC." . PHP_EOL . PHP_EOL .
					'Error [type ' . $error['type'] . ']: ' . PHP_EOL .
					$error['message'] . ' (' . $error['file'] . ' line ' . $error['line'] . ')';
				$headers = 'From: ' . PRODUCT_NAME . ' <' . strtolower(PRODUCT_NAME) . '@' . $server . '>';

				// send email to each admin
				foreach ($emails as $email) {
					mail($email, $subject, $message, $headers);
				}
				
			}
			
		}
	
	}
681048
def print_fatal_results(results, level=0):
    
    print_level(logger.critical, _RED + "[X] Fatal Error: %s", level, results.error)
645606
function error () {
  if (mocking) {
    cli.stderr += stripAnsi(concatArguments(arguments) + '\n')
  } else {
    console.error.apply(null, arguments)
  }
}
897654
def fatal(ftn, txt):
    """"""
    msg = "{0}.{1}:FATAL:{2}\n".format(modname, ftn, txt)
    raise SystemExit(msg)
180503
public function handleFatalError()
    {
        $this->reservedMemory = null;

        $lastError = error_get_last();

        if ($lastError && \in_array($lastError['type'], self::$fatalErrors, true)) {
            $this->logger->log(
                $this->fatalLevel ?? LogLevel::ALERT,
                'Fatal Error (' . self::codeToString($lastError['type']) . '): ' . $lastError['message'],
                [
                    'code' => $lastError['type'],
                    'message' => $lastError['message'],
                    'file' => $lastError['file'],
                    'line' => $lastError['line']
                ]
            );

            if (method_exists($this->logger, 'flush')) {
                $this->logger->flush();
            }

            if ($this->logger instanceof Logger) {
                foreach ($this->logger->getHandlers() as $handler) {
                    if ($handler instanceof AbstractHandler) {
                        $handler->close();
                    }
                }
            }
        }
    }
80533
public function onRequestTerminate() 
  {
    // lets see if there were unhandled fatal errors
    $lasterror=error_get_last();
    if(!is_null($lasterror)){
      if($lasterror['type'] & (E_ERROR | E_PARSE | E_CORE_ERROR | E_COMPILE_ERROR | E_USER_ERROR | E_RECOVERABLE_ERROR)){
        // fatal error occured
        // increase memory limit so we we can at least complete our error handling (in case it was Allowed memory size exhausted)
        // (adding 1MB, unless already unlimited)
        $memlim=Web2All_PHP_INI::getBytes(ini_get('memory_limit'));
        if($memlim!=-1){
          ini_set('memory_limit',$memlim+1000000);
        }
        // then add this error to the observers
        $error = Web2All_Manager_Error::getInstance();
        $exception = new Web2All_Manager_TriggerException($lasterror['type'], $lasterror['message'], $lasterror['file'], $lasterror['line'], array());
        if ($error) {
          $error->setState($exception,$lasterror['type']);
        }
      }
    }
  }
686650
public function onShutdown()
    {
        // Get the last error if there was one, if not, let's get out of here.
        if (!$error = error_get_last()) {
            return;
        }

        $fatal  = array(E_ERROR,E_PARSE,E_CORE_ERROR,E_COMPILE_ERROR,E_USER_ERROR,E_RECOVERABLE_ERROR);
        if (!in_array($error['type'], $fatal)) {
            return;
        }

        $message   = '[Shutdown Error]: %s';
        $message   = sprintf($message, $error['message']);
        $backtrace = array(array('file' => $error['file'], 'line' => $error['line']));

        $this->client->notifyOnError($message, $backtrace, 'error');
        error_log($message.' in: '.$error['file'].':'.$error['line']);
    }
1229525
private void fatal(String message, String textFound, String textExpected)
            throws SAXException {
        // smart quotes -- 2005-08-20 hsivonen
        if (textFound != null) {
            message = message + " (found \u201C" + textFound + "\u201D)";
        }
        if (textExpected != null) {
            message = message + " (expected \u201C" + textExpected + "\u201D)";
        }
        handler.fatal(message);

        // "can't happen"
        throw new FatalSAXException(message);
    }
1147418
def exit_cleanly(errnum=None):
    
    default = "An Unknown Error has Occurred!"
    cases = {errno.EINVAL: "Improper or invalid input value",
             errno.ESPIPE: "Could not complete action due to a broken" +
             " dependency",
             errno.ENOSYS: "Could not complete action due to unexpected setup",
             errno.EIO: "Could not access an expected file",
             errno.EPERM: "Could not access an item due to permissions issues",
             -1: default}
    help_stmt = """
%s [--opt [option]]
    With opts:
        working_directory - ONLY use this if you're overwriting `pwd`!
    """ % (sys.argv[0])
    if not errnum:
        errnum = 0
    elif not isinstance(errnum, int) and hasattr(errno, errnum):
        errnum = getattr(errno, errnum)
    try:
        errnum = int(errnum)
    except TypeError:
        errnum = -1
    if errnum == 0:
        help_stmt = ''
        stmt = "Successful in configuration!"
    elif errnum in cases:
        stmt = cases[errnum]
    else:
        stmt = default
    print("%s\n\n%s" % (stmt, help_stmt))
162437
def die(arg, msg = nil, error_code = nil)
			msg, error_code = nil, msg if msg.kind_of?(Integer)
			if msg
				$stderr.puts "Error: argument --#{@specs[arg].long} #{msg}."
			else
				$stderr.puts "Error: #{arg}."
			end
			if @educate_on_error
				$stderr.puts
				educate $stderr
			else
				$stderr.puts "Try --help for help."
			end
			exit(error_code || -1)
		end
1203417
def exit_with_error(message):
    
    click.secho(message, err=True, bg='red', fg='white')
    sys.exit(0)
463288
def on_terminate(func):
    """"""
    def exit_function(*args):
        func()
        exit(0)
    signal.signal(signal.SIGTERM, exit_function)
694720
function createError(name, options)
{
  // TODO: validate that name is a string and options is an object

  // TODO: this code is a bit of a mess and needs to be cleaned up

  // create a new error
  var error = new Error();

  // set its name
  error.name = name;

  // set the error code
  var code;
  error.code = code = options.code;

  // if no error message was specified in the options
  var message = options.message;
  if (!message)
  {
    // use the error code to get the error message template
    var messageTemplate = errorMessages[code];

    // if some error message arguments were specified, substitute them into the
    // error message template to get the full error message, otherwise just use
    // the error message template as the error message
    var messageArgs = options.messageArgs;
    if (messageArgs)
    {
      messageArgs = messageArgs.slice();
      messageArgs.unshift(messageTemplate);
      message = Util.format.apply(Util, messageArgs);
    }
    else
    {
      message = messageTemplate;
    }
  }
  error.message = message;

  // if no sql state was specified in the options, use the error code to try to
  // get the appropriate sql state
  var sqlState = options.sqlState;
  if (!sqlState)
  {
    sqlState = errCodeToSqlState[code];
  }
  error.sqlState = sqlState;

  // set the error data
  error.data = options.data;

  // set the error response and response body
  error.response     = options.response;
  error.responseBody = options.responseBody;

  // set the error cause
  error.cause = options.cause;

  // set the error's fatal flag
  error.isFatal = options.isFatal;

  // if the error is not synchronous, add an externalize() method
  if (!options.synchronous)
  {
    error.externalize = function(errorCode, errorMessageArgs, sqlState)
    {
      var propNames =
      [
        'name',
        'code',
        'message',
        'sqlState',
        'data',
        'response',
        'responseBody',
        'cause',
        'isFatal',
        'stack'
      ];

      var externalizedError = new Error();

      var propName, propValue;
      for (var index = 0, length = propNames.length; index < length; index++)
      {
        propName = propNames[index];
        propValue = this[propName];
        if (Util.exists(propValue))
        {
          externalizedError[propName] = propValue;
        }
      }

      return externalizedError;
    };
  }

  return error;
}