Log a HTTP error response.
@param uri The URI used for the HTTP call
@param response The HTTP call response
332620
private void logResponse(URI uri, Response response)
    {
        if(logger.isLoggable(Level.FINE))
            logger.fine(uri.toString()+" => "+response.getStatus());
        if(response.getStatus() > 300)
            logger.warning(response.toString());
    }
1176148
public void handleResponse(String response) {
        if (messageListener != null) {
            log.debug("Sending Http response");
            messageListener.onOutboundMessage(new RawMessage(response), null);
        } else {
            if (log.isDebugEnabled()) {
                log.debug("Sending Http response:" + NEWLINE + response);
            }
        }
    }
846915
protected void receiveClientResponse(HttpMessage response) {
        runner.http(action -> {
            HttpClientResponseActionBuilder responseBuilder = action.client(httpClient).receive()
                .response(response.getStatusCode())
                .message(response);

            for (Map.Entry<String, String> headerEntry : pathValidations.entrySet()) {
                responseBuilder.validate(headerEntry.getKey(), headerEntry.getValue());
            }
            pathValidations.clear();
        });
    }
979576
public static void checkUri(String uri, String message, Object... args) {
    try {
      new URI(uri);
    } catch (URISyntaxException e) {
      throw new IllegalArgumentException(String.format(message, args), e);
    }
  }
64441
public void doGet(String url, HttpResponse response) {
        doGet(url, response, null, true);
    }
261039
public void sendError(HttpResponse response,int code,String msg)
    	throws IOException
    {
        Object wrapper = response.getWrapper();
        if (wrapper!=null && wrapper instanceof HttpServletResponse)
            ((HttpServletResponse)wrapper).sendError(code,msg);
        else
            super.sendError(response,code,msg);
    }
597984
public void error(String format, Object arg) {
        formatAndLog(LOG_LEVEL_ERROR, format, arg, null);
    }
705562
public static HttpResponseException throwHttpResponseException(HttpClientResponse response)
    throws IOException
    {
        LOG.warn("Remote service responded to \"%s\" with code %d (cause: %s) %s", response.getUri(), response.getStatusCode(), response.getStatusText(), printData(response));
        throw new HttpResponseException(response);
    }
47296
public void setResponse(String response) {
		this.response = response;
		try {
			this.responseLength = response.getBytes("UTF-8").length;
		} catch (UnsupportedEncodingException e) {
			this.responseLength = response.length();
		}
	}
405298
private void processRedirectResponse(Response response) throws RuntimeException, JSONException, MalformedURLException {
        // a valid redirect response must contain the Location header.
        ResponseImpl responseImpl = (ResponseImpl)response;
        List<String> locationHeaders = responseImpl.getHeader(LOCATION_HEADER_NAME);

        String location = (locationHeaders != null && locationHeaders.size() > 0) ? locationHeaders.get(0) : null;

        if (location == null) {
            throw new RuntimeException("Redirect response does not contain 'Location' header.");
        }

        // the redirect location url should contain "wl_result" value in query parameters.
        URL url = new URL(location);
        String query = url.getQuery();

        if (query.contains(WL_RESULT)) {
            String result = Utils.getParameterValueFromQuery(query, WL_RESULT);
            JSONObject jsonResult = new JSONObject(result);

            // process failures if any
            JSONObject jsonFailures = jsonResult.optJSONObject(AUTH_FAILURE_VALUE_NAME);

            if (jsonFailures != null) {
                processFailures(jsonFailures);
                listener.onFailure(response, null, null);
                return;
            }

            // process successes if any
            JSONObject jsonSuccesses = jsonResult.optJSONObject(AUTH_SUCCESS_VALUE_NAME);

            if (jsonSuccesses != null) {
                processSuccesses(jsonSuccesses);
            }
        }

        // the rest is handles by the caller
        listener.onSuccess(response);
    }
703778
def _log_error(self, request, error):
        ''''''
        _logger.error(
            _('Fetching ‘{url}’ encountered an error: {error}'),
            url=request.url, error=error
        )
1111031
public void assertCorrectResonse(JSONObject response) throws JSONException {
		Integer lastHTTPResponseCode = getLastHTTPResponseCode();
		if(lastHTTPResponseCode != null) {
			//if a response code is set, check it. Selenium requests do not let you query this which is why we can't check this in case of a selenium API call
			assertEquals("The https response code should be 200 (OK)", new Integer(HttpURLConnection.HTTP_OK), lastHTTPResponseCode);
		}
		assertNotNull("The request should result in a response", response);	
	}
74769
private static void log(final RqFallback req) throws IOException {
        final ByteArrayOutputStream baos = new ByteArrayOutputStream();
        final Throwable error = req.throwable();
        try (PrintStream stream = new Utf8PrintStream(baos, false)) {
            error.printStackTrace(stream);
        }
        FbSlf4j.LOGGER.error(
            "{} {} failed with {}: {}",
            new RqMethod.Base(req).method(),
            new RqHref.Base(req).href(),
            req.code(),
            baos.toString("UTF-8")
        );
    }
1014563
def response_of_uri(uri)
      begin
        Net::HTTP.start(uri.host, uri.port) do |http|
          http.head(uri.path.size > 0 ? uri.path : "/").code
        end
      rescue Exception => e
        "Error"
      end
    end
1248572
@Override
	public void analyze(Response response) {
		if(response == null) {
			return;
		}
		
		if (ResponseHandler.LOG.equals(response.getAction())) {
			logger.info("Handling <log> response for user <{}>", response.getUser().getUsername());
		} else {
			logger.info("Delegating response for user <{}> to configured response handler <{}>", 
					response.getUser().getUsername(), responseHandler.getClass().getName());
			responseHandler.handle(response);
		}
		
	}
840142
public void sendError( ServletRequest request, ServletResponse response )
        throws IOException
    {
        InternalUtils.sendError( _messageKeyPrefix, getMessageArgs(), request, response, null,
                                 InternalUtils.avoidDirectResponseOutput( request ) );
    }
355570
private void logSlowRequests(long requestLifetime, Request<?> request,
                                 byte[] responseContents, Response response) {
        if (DEBUG || requestLifetime > SLOW_REQUEST_THRESHOLD_MS) {
            VolleyLog.d("HTTP response for request=<%s> [lifetime=%d], [size=%s], " +
                            "[rc=%d], [retryCount=%s]", request, requestLifetime,
                    responseContents != null ? responseContents.length : "null",
                    response.code(), request.getRetryPolicy()
                            .getCurrentRetryCount()
            );
        }
    }