This function is called whenever there was a sending failure - an error received or an exception raised
965675
private function logFailure()
  {
    if ($this->_debug) {
      printf("[LoadBalancer] Failed for %s<br />\n", $this->_connectionStrings[$this->_lastReturnedIndex] . (isset($this->_storageNames[$this->_lastReturnedIndex]) ? '|' . $this->_storageNames[$this->_lastReturnedIndex] : ''));
    }
    $hash = md5($this->_connectionStrings[$this->_lastReturnedIndex] . (isset($this->_storageNames[$this->_lastReturnedIndex]) ? '|' . $this->_storageNames[$this->_lastReturnedIndex] : ''));
    touch($this->_statusFilePrefix . $hash);
  }
248130
def _raise_or_append_exception(self):
        
        message = (
            'Connection dead, no heartbeat or data received in >= '
            '%ds' % (
                self._interval * 2
            )
        )
        why = AMQPConnectionError(message)
        if self._exceptions is None:
            raise why
        self._exceptions.append(why)
94739
public void sendError(int status, String message)
        throws IOException
    {
        // Find  error page.
        String error_page =
            _servletHttpRequest.getServletHandler().getErrorPage(status,_servletHttpRequest);

        resetBuffer();
        
        // Handle error page?
        if (error_page==null)
        {
            // handle normally
            _httpResponse.sendError(status,message);
        }
        else
        {   
            _httpResponse.setStatus(status,message);
            
            if (message == null)
            {
                message= (String)HttpResponse.__statusMsg.get(TypeUtil.newInteger(status));
                if (message == null)
                    message= "" + status;
            }

            // handle error page
            ServletHolder holder = _servletHttpRequest.getServletHolder();
            if (holder!=null)
                _servletHttpRequest.setAttribute(ServletHandler.__J_S_ERROR_SERVLET_NAME,
                                                 holder.getName());
            _servletHttpRequest.setAttribute(ServletHandler.__J_S_ERROR_REQUEST_URI,
                                             _servletHttpRequest.getRequestURI());
            _servletHttpRequest.setAttribute(ServletHandler.__J_S_ERROR_STATUS_CODE,
                                             new Integer(status));
            _servletHttpRequest.setAttribute(ServletHandler.__J_S_ERROR_MESSAGE,
                                             message);
            
            RequestDispatcher dispatcher=
                _servletHttpRequest.getServletHandler().getServletContext()
                .getRequestDispatcher(error_page);

            try
            {
                ((Dispatcher)dispatcher).error(_servletHttpRequest,this);
            }
            catch(ServletException e)
            {
                log.warn(LogSupport.EXCEPTION,e);
                _httpResponse.sendError(status,message); 
            }
        }
        complete();
    }
930483
function onRequestError(error, result, endCallback) {
      result.currentRetries++;
      async.parallel([
        async.apply(recrawlError, error, result),
        async.apply(retrySameUrl,error, result)
      ],function(error){
          endCallback(error);
      });

  }
573373
def _on_report_error(self, code, message, connection_id):
        """"""
        self._logger.critical(
            "Error receiving reports, no more reports will be processed on this adapter, code=%d, msg=%s", code, message
        )
1066051
function sendError(error, params) {
    checkParams(params);
    
    params.status = FILE_NOT_FOUND;
    
    const data = error.message || String(error);
    
    logError(error.stack);
    
    send(data, params);
}
1257692
def handle_transport_fail(self, exception=None, **kwargs):
        
        message = str(exception)
        logger.error("Failed to submit message: %r", message, exc_info=getattr(exception, "print_trace", True))
        self.state.set_fail()
1281151
def handle_error(self):
        """"""
        if self.server.can_ignore_error(self):
            return
        if thread_local.status_code is None:
            msg("ERROR: Cannot send error status code! " +
                "Header already sent!\n{0}", traceback.format_exc())
        else:
            msg("ERROR: Error while processing request:\n{0}",
                traceback.format_exc())
            try:
                self.send_error(500, "Internal Error")
            except:  # nopep8
                if self.server.can_ignore_error(self):
                    return
                msg("ERROR: Cannot send error status code:\n{0}",
                    traceback.format_exc())
351021
def _handle_error(self, data, params):
        """"""
        error = data.get('error', 'API call failed')
        mode = params.get('mode')
        raise SabnzbdApiException(error, mode=mode)
78444
public void sendError(int status) throws IOException {
        if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) {  //306998.15
            logger.logp(Level.FINE, CLASS_NAME,"sendError", "error --> "+ String.valueOf(status),"["+this+"]");
        }

        Object[] args = { new Integer(status) };
        sendError(status, MessageFormat.format(nls.getString("Error.reported.{0}", "Error reported: {0}"), args));
    }
177742
def raise_on_error(f):
    

    @functools.wraps(f)
    def wrapper(*args, **kwargs):
        result = f(*args, **kwargs)
        retcode = GetLastError()
        if retcode and retcode != ERROR_IO_PENDING:
            err = WinError(code=retcode)
            windll.kernel32.SetLastError(0)  # clear error code so that we don't raise twice.
            raise err
        return result

    return wrapper
150817
protected void sendErrorIfSender(Throwable throwable) {
		if (!getSender().equals(ActorRef.noSender())) {
			getSender().tell(new Status.Failure(throwable), getSelf());
		}
	}
859202
function _onError(error) {
        if (_connectDeferred) {
            _connectDeferred.reject();
            _connectDeferred = null;
        }
        exports.trigger("error", error);
    }
201946
def _raise_error_if_disconnected(self) -> None:
        
        if (
            self.transport is None
            or self.protocol is None
            or self.transport.is_closing()
        ):
            self.close()
            raise SMTPServerDisconnected("Disconnected from SMTP server")
967313
def send_error(self, status_code=500, **kwargs):
        
        if hasattr(super(SentryMixin, self), 'log_exception'):
            return super(SentryMixin, self).send_error(status_code, **kwargs)
        else:
            rv = super(SentryMixin, self).send_error(status_code, **kwargs)
            if 500 <= status_code <= 599:
                self.captureException(exc_info=kwargs.get('exc_info'))
            return rv
318677
public static void sendError(int errorCode, String errorContent) {
		HttpServletResponse response = Response.getServletResponse();
		try {
			if(HuluSetting.isDevMode) {
				response.sendError(errorCode);
			}else {
				response.sendError(errorCode, errorContent);
			}
		} catch (IOException e) {
			log.error(e, "Error when sendError!");
		}
	}
938594
def _handle_processing_error(err, errstream, client):
    """"""

    errors = sorted(err.events, key=operator.attrgetter("index"))
    failed = [e.event for e in errors]
    silent = all(isinstance(e.error, OutOfOrderError) for e in errors)
    if errstream:
        _deliver_errored_events(errstream, failed)
        must_raise = False
    else:
        must_raise = True
    for _, event, error, tb in errors:
        if isinstance(error, OutOfOrderError):
            # Not really an error: do not log this to Sentry
            continue
        try:
            raise six.reraise(*tb)
        except Exception as err:
            if client:
                client.captureException()
            msg = "{}{}: {}".format(type(err).__name__,
                    err.args, json.dumps(event, indent=4))
            rlogger.error(msg, exc_info=tb)
            if must_raise:
                raise