Log an error.  By default this will also raise an exception.
894
def error(self, *args):
        """"""
        if _canShortcutLogging(self.logCategory, ERROR):
            return
        errorObject(self.logObjectName(), self.logCategory,
            *self.logFunction(*args))
682540
def exception_logger(exc_type, exc_value, exc_traceback):
    """"""
    if not issubclass(exc_type, KeyboardInterrupt):  # do not log Ctrl-C
        _log.critical(
            "Uncaught exception:",
            exc_info=(exc_type, exc_value, exc_traceback)
        )
    sys.__excepthook__(exc_type, exc_value, exc_traceback)
1275270
def _log_exception(self, exception):
        
        self._io.error(str(exception).strip().split(os.linesep))
230256
function logError($errorMessage, \Exception $exception)
    {
        if ($this->logger instanceof LoggerInterface) {
            $this->logger->error($errorMessage . "\n" . $exception->getTraceAsString());
        }
    }
539403
function log(err) {
    if (_logger) {
      if (typeof(err) == 'string') {
        err = { message: err, code: 0 }
      }
      _logger(err);
    }
  }
163468
public static void error(Log log, Throwable e) {
		error(log, e, e.getMessage());
	}
760975
def raise_error(
            self,
            exception_type,  # type: Type[Exception]
            message  # type: Text
    ):
        # type: (...) -> NoReturn
        """"""
        error_message = '{} at {}'.format(message, repr(self))
        raise exception_type(error_message)
640872
def _handle_exception():
    """"""
    # Heavily influenced by logging.Handler.handleError.

    # See note here:
    # https://docs.python.org/3.4/library/sys.html#sys.__stderr__
    if sys.stderr:
        einfo = sys.exc_info()
        try:
            traceback.print_exception(einfo[0], einfo[1], einfo[2],
                                      None, sys.stderr)
        except IOError:
            pass
        finally:
            del einfo
945937
public void error(String msg, Throwable e) {
        doLog(msg, LOG_ERROR, null, e);
    }
176360
def log_exception(fn_name, exception, retry_count, **kwargs):
    
    _log_exception_hook(fn_name, exception, retry_count, **kwargs)
597984
public void error(String format, Object arg) {
        formatAndLog(LOG_LEVEL_ERROR, format, arg, null);
    }
202688
def raise_exception(self, node, exc=None, msg='', expr=None,
                        lineno=None):
        """"""
        if self.error is None:
            self.error = []
        if expr is None:
            expr = self.expr
        if len(self.error) > 0 and not isinstance(node, ast.Module):
            msg = '%s' % msg
        err = ExceptionHolder(node, exc=exc, msg=msg, expr=expr, lineno=lineno)
        self._interrupt = ast.Break()
        self.error.append(err)
        if self.error_msg is None:
            self.error_msg = "at expr='%s'" % (self.expr)
        elif len(msg) > 0:
            self.error_msg = msg
        if exc is None:
            try:
                exc = self.error[0].exc
            except:
                exc = RuntimeError
        raise exc(self.error_msg)
74591
def error(self, msg, *args, **kwargs) -> Task:  # type: ignore
        
        return self._make_log_task(logging.ERROR, msg, args, **kwargs)
557966
def log_error(*error, cause=None):
    
    thread_id = threading.current_thread().ident
    text = " ".join(error)
    if cause:
        text += " due to " + str(cause)

    logger = get_logger()
    logger.error(LOG_THREAD_FORMAT.format(thread_id, text))
110790
def log_exception(self, exception_info: Tuple[type, BaseException, TracebackType]) -> None:
        
        if has_request_context():
            request_ = _request_ctx_stack.top.request
            self.logger.error(
                f"Exception on request {request_.method} {request_.path}",
                exc_info=exception_info,
            )
        if has_websocket_context():
            websocket_ = _websocket_ctx_stack.top.websocket
            self.logger.error(
                f"Exception on websocket {websocket_.path}",
                exc_info=exception_info,
            )
603468
function logError(log, err) {
    let debug = log.debug || log.trace || log.log;
    if (err.Fault) {
        log.error(err.Fault);
        if (err.response && err.response.request) {
            log.error("URL: " + err.response.request.href);
        }
        if (err.body) debug(err.body);
    } else {
        log.error(err.stack ? err.stack : err);
    }
}
1005497
def handle_error(self, code, message_values=None, raise_error=True):
        
        try:
            if message_values is None:
                message_values = []
            message = self.error_codes.message(code).format(*message_values)
            self.log.error('Error code: {}, {}'.format(code, message))
        except AttributeError:
            self.log.error('Incorrect error code provided ({}).'.format(code))
            raise RuntimeError(1000, 'Generic Failure, see logs for more details.')
        except IndexError:
            self.log.error(
                'Incorrect message values provided for error code {} ({}).'.format(
                    code, message_values
                )
            )
            raise RuntimeError(1000, 'Generic Failure, see logs for more details.')
        if raise_error:
            raise RuntimeError(code, message)