Handle an unhandled exception. By convention, returns true if further error handling should be suppressed and false otherwise. In this case, we will only suppress further error handling if the "ignoreGlobalErrors" configuration option is enabled.
965447
function onError(error) {
  	for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  		args[_key - 1] = arguments[_key];
  	}

  	if (config.current) {
  		if (config.current.ignoreGlobalErrors) {
  			return true;
  		}
  		pushFailure.apply(undefined, [error.message, error.fileName + ":" + error.lineNumber].concat(args));
  	} else {
  		test("global failure", extend(function () {
  			pushFailure.apply(undefined, [error.message, error.fileName + ":" + error.lineNumber].concat(args));
  		}, { validTest: true }));
  	}

  	return false;
  }
103622
public static void setDefaultUncaughtExceptionHandler (@Nonnull final Thread.UncaughtExceptionHandler aHdl)
  {
    ValueEnforcer.notNull (aHdl, "DefaultUncaughtExceptionHandler");
    s_aDefaultUncaughtExceptionHandler = aHdl;
  }
197170
def _call_exception_handlers(exception):
  """"""
  for handler in EXCEPTION_HANDLERS:
    try:
      if handler.wants(exception):
        handler.handle(exception)
    except:  # pylint: disable=bare-except
      try:
        # We don't want to stop for exceptions in the exception handlers but
        # we shouldn't hide them either.
        logging.error(traceback.format_exc())
      except:  # pylint: disable=bare-except
        # In case even the logging statement fails, ignore.
        pass
246989
def catch_error(exception)
      if handler = handler_for_error(exception)
        handler.arity.zero? ? handler.call : handler.call(exception)
        true
      end
    end
412458
protected void handleError(String errMsg) throws Exception {
    // log it
    LOGGER.log(Level.SEVERE, errMsg);
    // and throw an error if this is configured
    if (this.isThrowExceptionOnError()) {
      throw new Exception(errMsg);
    }
  }
1090948
@Override
	public void onUncaughtException(Throwable throwable) {
		for (ErrorHandler handler : this.errorHandlers) {
			if (handler.handle(throwable)) {
				return;
			}
		}
		this.defaultHandler.handle(throwable);
	}
701354
function handleUncaught (server, enabled) {
  if (!enabled) {
    return
  }

  process.once('uncaughtException', (err) => {
    err = Object.assign({ source: getErrorSource(err) }, objectify(err))
    server.log(['uncaught', 'error'], { err })
    process.exit(1)
  })
}
362090
def wrap_errorhandler(app):
        
        try:
            existing_handler = app.error_handler_spec[None][404][NotFound]
        except (KeyError, TypeError):
            existing_handler = None

        if existing_handler:
            app.error_handler_spec[None][404][NotFound] = \
                lambda error: handle_not_found(error, wrapped=existing_handler)
        else:
            app.error_handler_spec.setdefault(None, {}).setdefault(404, {})
            app.error_handler_spec[None][404][NotFound] = handle_not_found
99096
private int handleError(Throwable t) {
		System.out.println("Error: " + t.getMessage());
		if (this.verbose) {
			t.printStackTrace();
		} else {
			System.out.println("For a more detailed error message use the vebose output option '-v'.");
		}
		return 1;
	}
427300
def exception_handler(exctype, value, traceback):
    
    if exctype == KeyboardInterrupt:
        pypro.console.out('')  # Adds a new line after Ctrl+C character
        pypro.console.err('Canceled')
    elif exctype == PyproException:
        pypro.console.err('[Error] ', value.message)
        exit()
    else:
        sys.__excepthook__(exctype, value, traceback)
1008177
def close_alert(self, ignore_exception=False):
        
        try:
            alert = self.get_alert()
            alert.accept()
        except:
            if not ignore_exception:
                raise
474606
private boolean handleException(final Throwable t,
                                  final HttpServletResponse resp,
                                  final boolean serverError) {
    if (serverError) {
      return true;
    }

    try {
      error(t);
      sendError(t, resp);
      return true;
    } catch (Throwable t1) {
      // Pretty much screwed if we get here
      return true;
    }
  }
171177
private void defineUncaughtExceptionHandler() {
        MethodInfo mi = mClassFile.addMethod
            (Modifiers.PRIVATE.toStatic(true), UNCAUGHT_METHOD_NAME, null,
             new TypeDesc[] {TypeDesc.forClass(Throwable.class)});
        CodeBuilder b = new CodeBuilder(mi);

        // Thread t = Thread.currentThread();
        // t.getUncaughtExceptionHandler().uncaughtException(t, e);
        TypeDesc threadType = TypeDesc.forClass(Thread.class);
        b.invokeStatic(Thread.class.getName(), "currentThread", threadType, null);
        LocalVariable threadVar = b.createLocalVariable(null, threadType);
        b.storeLocal(threadVar);
        b.loadLocal(threadVar);
        TypeDesc handlerType = TypeDesc.forClass(Thread.UncaughtExceptionHandler.class);
        b.invokeVirtual(threadType, "getUncaughtExceptionHandler", handlerType, null);
        b.loadLocal(threadVar);
        b.loadLocal(b.getParameter(0));
        b.invokeInterface(handlerType, "uncaughtException", null,
                          new TypeDesc[] {threadType, TypeDesc.forClass(Throwable.class)});
        b.returnVoid();
    }
569699
function (isGlobal, server, err, msg, session, resp, opts, cb) {
  let handler;
  if (isGlobal) {
    handler = server.app.get(Constants.RESERVED.GLOBAL_ERROR_HANDLER);
  } else {
    handler = server.app.get(Constants.RESERVED.ERROR_HANDLER);
  }
  if (!handler) {
    logger.debug('no default error handler to resolve unknown exception. ' + err.stack);
    utils.invokeCallback(cb, err, resp, opts);
  } else {
    if (handler.length === 5) {
      handler(err, msg, resp, session, cb);
    } else {
      handler(err, msg, resp, session, opts, cb);
    }
  }
}
1361416
def handle_exception(error):
        
        response = jsonify(error.to_dict())
        response.status_code = error.status_code
        return response
141781
@Override
  protected void handleError(Suppressible s, Throwable t) {
    if (t instanceof ErrorProneError) {
      throw (ErrorProneError) t;
    }
    if (t instanceof CompletionFailure) {
      throw (CompletionFailure) t;
    }
    TreePath path = getCurrentPath();
    throw new ErrorProneError(
        s.canonicalName(),
        t,
        (DiagnosticPosition) path.getLeaf(),
        path.getCompilationUnit().getSourceFile());
  }
1301650
def handleError(self, test, err, capt=None):
        
        if not hasattr(test.test, "testcase_guid"):
            if err[0] == errors.BlockedTest:
                raise SkipTest(err[1])
                return True

            elif err[0] == errors.DeprecatedTest:
                raise SkipTest(err[1])
                return True

            elif err[0] == errors.SkipTest:
                raise SkipTest(err[1])
                return True