Load Balancers all have a default error page that is shown to
        an end user who is attempting to access a load balancer node
        that is offline/unavailable.
422036
def get_error_page(self, loadbalancer):
        
        uri = "/loadbalancers/%s/errorpage" % utils.get_id(loadbalancer)
        resp, body = self.api.method_get(uri)
        return body
823846
def connection_errors
      [
        Redis::BaseConnectionError,
        Redis::TimeoutError,
        IOError,
        Timeout::Error,
        Errno::EADDRNOTAVAIL,
        Errno::EAGAIN,
        Errno::EBADF,
        Errno::ECONNABORTED,
        Errno::ECONNREFUSED,
        Errno::ECONNRESET,
        Errno::EHOSTUNREACH,
        Errno::EINVAL,
        Errno::ENETUNREACH,
        Errno::EPIPE,
      ]
    end
1301803
def cli(env, identifier, allocation, port, routing_type, routing_method):
    """"""

    mgr = SoftLayer.LoadBalancerManager(env.client)

    _, loadbal_id = loadbal.parse_id(identifier)

    mgr.add_service_group(loadbal_id,
                          allocation=allocation,
                          port=port,
                          routing_type=routing_type,
                          routing_method=routing_method)

    env.fout('Load balancer service group is being added!')
1114754
def elbv2_load_balancer_dns_name(self, lookup, default=None):
    
    try:
      elb = self._elbv2_load_balancer(lookup)
      return elb['DNSName']
    except ClientError:
      return default
782658
def cli(env, identifier):
    """"""
    mgr = SoftLayer.LoadBalancerManager(env.client)

    loadbal_id, group_id = loadbal.parse_id(identifier)

    mgr.reset_service_group(loadbal_id, group_id)
    env.fout('Load balancer service group connections are being reset!')
280843
def server_error(request, template_name="errors/500.html"):
    
    context = {"STATIC_URL": settings.STATIC_URL}
    t = get_template(template_name)
    return HttpResponseServerError(t.render(context, request))
884208
function errorPage(res, err) {
		if (err) {
			console.error(err.message);
			res.send(err, {'Content-Type': 'text/plain'}, 500);
		} else {
			res.send(404);
		}
	}
748820
def parse_error(error)
      case error
      when SocketError
        PuppetDebugger::Exception::ConnectError.new(message: "Unknown host: #{Puppet[:server]}")
      when Net::HTTPError
        PuppetDebugger::Exception::AuthError.new(message: error.message)
      when Errno::ECONNREFUSED
        PuppetDebugger::Exception::ConnectError.new(message: error.message)
      when Puppet::Error
        if error.message =~ /could\ not\ find\ class/i
          PuppetDebugger::Exception::NoClassError.new(default_modules_paths: default_modules_paths,
                                                      message: error.message)
        elsif error.message =~ /default\ node/i
          PuppetDebugger::Exception::NodeDefinitionError.new(default_site_manifest: default_site_manifest,
                                                             message: error.message)
        else
          error
        end
      else
        error
      end
    end
1040578
def cli(env, identifier, allocation, port, routing_type, routing_method):
    """"""
    mgr = SoftLayer.LoadBalancerManager(env.client)

    loadbal_id, group_id = loadbal.parse_id(identifier)

    # check if any input is provided
    if not any([allocation, port, routing_type, routing_method]):
        raise exceptions.CLIAbort(
            'At least one property is required to be changed!')

    mgr.edit_service_group(loadbal_id,
                           group_id,
                           allocation=allocation,
                           port=port,
                           routing_type=routing_type,
                           routing_method=routing_method)

    env.fout('Load balancer service group %s is being updated!' % identifier)
832149
function errorHandler(conn) {
  return function(err) {
    if (connectionAccounting) deleteConnection(conn.id);
    // Debug information
    if (conn.logger.isDebug()) {
      conn.logger.debug(
        `connection ${conn.id} for [${conn.address}] errored out with [${JSON.stringify(err)}]`
      );
    }

    conn.emit('error', new MongoNetworkError(err), conn);
  };
}
1167156
private void errorHandling(CmsObject cms, HttpServletRequest req, HttpServletResponse res, Throwable t) {

        // remove the controller attribute from the request
        CmsFlexController.removeController(req);

        boolean canWrite = (!res.isCommitted() && !res.containsHeader("Location"));
        int status = -1;
        boolean isGuest = true;

        if (t instanceof ServletException) {
            ServletException s = (ServletException)t;
            if (s.getRootCause() != null) {
                t = s.getRootCause();
            }
            LOG.error(t.getLocalizedMessage() + " rendering URL " + req.getRequestURL(), t);
        } else if (t instanceof CmsSecurityException) {
            LOG.warn(t.getLocalizedMessage() + " rendering URL " + req.getRequestURL(), t);
            // access error - display login dialog
            if (canWrite) {
                try {
                    m_authorizationHandler.requestAuthorization(req, res, getLoginFormURL(req, res));
                } catch (IOException ioe) {
                    LOG.debug("Error calling authorization handler.", ioe);
                }
                return;
            }
        } else if (t instanceof CmsDbEntryNotFoundException) {
            LOG.warn(t.getLocalizedMessage() + " rendering URL " + req.getRequestURL(), t);
            // user or group does not exist
            status = HttpServletResponse.SC_SERVICE_UNAVAILABLE;
            isGuest = false;
        } else if (t instanceof CmsVfsResourceNotFoundException) {
            LOG.warn(t.getLocalizedMessage() + " rendering URL " + req.getRequestURL(), t);
            // file not found - display 404 error.
            status = HttpServletResponse.SC_NOT_FOUND;
        } else if (t instanceof CmsException) {
            LOG.error(t.getLocalizedMessage() + " rendering URL " + req.getRequestURL(), t);
            if (t.getCause() != null) {
                t = t.getCause();
            }
        } else if (t.getClass().getName().equals("org.apache.catalina.connector.ClientAbortException")) {
            // only log to debug channel any exceptions caused by a client abort - this is tomcat specific
            LOG.debug(t.getLocalizedMessage() + " rendering URL " + req.getRequestURL(), t);
        } else {
            LOG.error(t.getLocalizedMessage() + " rendering URL " + req.getRequestURL(), t);
        }

        if (status < 1) {
            // error code not set - set "internal server error" (500)
            status = HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
        }
        res.setStatus(status);

        try {
            if ((cms != null) && (cms.getRequestContext().getCurrentUser() != null)) {
                isGuest = isGuest
                    && (cms.getRequestContext().getCurrentUser().isGuestUser()
                        || cms.userInGroup(
                            cms.getRequestContext().getCurrentUser().getName(),
                            OpenCms.getDefaultUsers().getGroupGuests()));
            }
        } catch (CmsException e) {
            // result is false
            LOG.error(e.getLocalizedMessage(), e);
        }

        if (canWrite) {
            res.setContentType("text/html");
            CmsRequestUtil.setNoCacheHeaders(res);
            if ((status != 404)
                && !isGuest
                && (cms != null)
                && (!CmsJsonPartFilter.isJsonRequest(req))
                && !cms.getRequestContext().getCurrentProject().isOnlineProject()) {
                try {
                    res.setStatus(HttpServletResponse.SC_OK);
                    res.getWriter().print(CmsErrorUI.getBootstrapPage(cms, t, req));
                } catch (IOException e) {
                    // can be ignored
                    LOG.error(e.getLocalizedMessage(), e);
                }
            } else {
                try {
                    res.sendError(status, t.toString());
                } catch (IOException e) {
                    // can be ignored
                    LOG.error(e.getLocalizedMessage(), e);
                }
            }
        }
    }
262247
function onClientError(err) {
    // Ignore ECONNRESET errors
    if ((err || {}).errno !== 'ECONNRESET') {
      log.error('An unhandled error occured when searching for the root DSE at "%s". Error: %j', url, err);
      if (hasEvents.call(self, 'error')) self.emit('error', err)
    }
  }
664958
def handle_url_error(error, endpoint, values):
    
    url = overlay_url_for(endpoint, **values)
    if url is None:
        exc_type, exc_value, tb = sys.exc_info()
        if exc_value is error:
            reraise(exc_type, exc_value, tb)
        else:
            raise error
    # url_for will use this result, instead of raising BuildError.
    return url
1213355
def format_load_balancer_configuration(result):
    '''
    
    '''
    from collections import OrderedDict
    # Only display parameters that have content
    order_dict = OrderedDict()
    if result.private_ip_address is not None:
        order_dict['privateIpAddress'] = format_private_ip_address(result.private_ip_address)
    if result.public_ip_address_resource_id is not None:
        order_dict['publicIpAddressResourceId'] = result.public_ip_address_resource_id
    if result.load_balancer_resource_id is not None:
        order_dict['loadBalancerResourceId'] = result.load_balancer_resource_id
    if result.probe_port is not None:
        order_dict['probePort'] = result.probe_port
    if result.sql_virtual_machine_instances is not None:
        order_dict['sqlVirtualMachineInstances'] = result.sql_virtual_machine_instances

    return order_dict
1001350
function loadDefault() {
  return {
    port: 8000,
    host: '127.0.0.1',
    root: './',
    logFormat: 'combined',
    middlewares: [
      {
        name: 'cors',
        cfg: {
          origin: true
        }
      },
      {
        name: 'morgan',
        cfg: {}
      },
      {
        name: 'serveStatic',
        cfg: {}
      },
      {
        name: 'serveIndex',
        cfg: {
          icons: true
        }
      }
    ]
  }
}
243410
def cli(env):
    """"""
    mgr = SoftLayer.LoadBalancerManager(env.client)

    routing_types = mgr.get_routing_types()
    table = formatting.KeyValueTable(['ID', 'Name'])
    table.align['ID'] = 'l'
    table.align['Name'] = 'l'
    table.sortby = 'ID'
    for routing_type in routing_types:
        table.add_row([routing_type['id'], routing_type['name']])
    env.fout(table)
1169982
function defaultErrorHandler(err, req, res) {
  if (err.name === 'UnauthorizedError') { // authentication is expected to be a common use-case
    res.status(401).end();
  } else {
    if (!err.status || err.status >= 500) {
      console.error(err.stack || err.toString());
    }
    res.status(err.status || 500).json({message: err.message})
  }
}