public void fatalProtocolException(final HttpException ex, final NHttpConnection conn) { logger.info("HTTP error: " + ex.getMessage()); } }
public void fatalProtocolException(final HttpException ex, final NHttpConnection conn) { logger.info("HTTP error: " + ex.getMessage()); } }
/** * Reads and stores the Trailer headers. * @throws IOException If an IO problem occurs */ private void parseTrailerHeaders() throws IOException { try { this.footers = AbstractMessageParser.parseHeaders (in, -1, -1, null); } catch (HttpException e) { IOException ioe = new MalformedChunkCodingException("Invalid footer: " + e.getMessage()); ExceptionUtils.initCause(ioe, e); throw ioe; } }
/** * Reads and stores the Trailer headers. * @throws IOException in case of an I/O error */ private void parseTrailerHeaders() throws IOException { try { this.footers = AbstractMessageParser.parseHeaders(in, constraints.getMaxHeaderCount(), constraints.getMaxLineLength(), null); } catch (final HttpException ex) { final IOException ioe = new MalformedChunkCodingException("Invalid footer: " + ex.getMessage()); ioe.initCause(ex); throw ioe; } }
protected void handleException(final HttpException ex, final HttpResponse response) { if (ex instanceof MethodNotSupportedException) { response.setStatusCode(HttpStatus.SC_NOT_IMPLEMENTED); } else if (ex instanceof UnsupportedHttpVersionException) { response.setStatusCode(HttpStatus.SC_HTTP_VERSION_NOT_SUPPORTED); } else if (ex instanceof ProtocolException) { response.setStatusCode(HttpStatus.SC_BAD_REQUEST); } else { response.setStatusCode(HttpStatus.SC_INTERNAL_SERVER_ERROR); } byte[] msg = EncodingUtils.getAsciiBytes(ex.getMessage()); ByteArrayEntity entity = new ByteArrayEntity(msg); entity.setContentType("text/plain; charset=US-ASCII"); response.setEntity(entity); }
public void run() { try { while (!Thread.interrupted() && connection.isOpen()) { log.fine("Handling request on open connection..."); HttpContext context = new BasicHttpContext(null); httpService.handleRequest(connection, context); } } catch (ConnectionClosedException ex) { log.fine("Client closed connection"); responseException(ex); } catch (SocketTimeoutException ex) { log.fine("Server-side closed socket (this is 'normal' behavior of Apache HTTP Core!): " + ex.getMessage()); } catch (IOException ex) { log.warning("I/O exception during HTTP request processing: " + ex.getMessage()); responseException(ex); } catch (HttpException ex) { throw new UnsupportedDataException("Request malformed: " + ex.getMessage(), ex); } finally { try { connection.shutdown(); } catch (IOException ex) { log.fine("Error closing connection: " + ex.getMessage()); } } }
public void fatalProtocolException(final HttpException ex, final NHttpConnection conn) { log.error("HTTP error: " + ex.getMessage()); } }
public void fatalProtocolException(final HttpException ex, final NHttpConnection conn) { logger.info("HTTP error: " + ex.getMessage()); } }
public void fatalProtocolException(final HttpException ex, final NHttpConnection conn) { if (LOG.isDebugEnabled()) { LOG.debug("HTTP error: " + ex.getMessage()); } }
public void fatalProtocolException(final HttpException ex, final NHttpConnection conn) { if (LOG.isDebugEnabled()) { LOG.debug("HTTP error: " + ex.getMessage()); } }
try { QueryExecution qe = query(string); } catch (HttpException ex) { System.out.println (ex.getMessage()); //Optional ex.printStackTrace(); //Optional }
private void warnProtocolViolation(HttpException e) { ss.warning(listener, "Can't connect to the Solr search engine. " + "Detected a protocol violation: " + e.getMessage(), e); }
/** * Handle Http protocol violations encountered while reading from underlying channels * * @param conn the connection being processed * @param e the exception encountered */ public void exception(final NHttpClientConnection conn, final HttpException e) { String message = getErrorMessage("HTTP protocol violation : " + e.getMessage(), conn); log.error(message, e); checkAxisRequestComplete(conn, NhttpConstants.PROTOCOL_VIOLATION, message, e); shutdownConnection(conn, true, "HTTP protocol violation : " + e.getMessage()); }
/** * Reads and stores the Trailer headers. * @throws IOException in case of an I/O error */ private void parseTrailerHeaders() throws IOException { try { this.footers = AbstractMessageParserHC4.parseHeaders (in, -1, -1, null); } catch (final HttpException ex) { final IOException ioe = new MalformedChunkCodingException("Invalid footer: " + ex.getMessage()); ioe.initCause(ex); throw ioe; } }
/** * Reads and stores the Trailer headers. * @throws IOException If an IO problem occurs */ private void parseTrailerHeaders() throws IOException { try { this.footers = AbstractMessageParser.parseHeaders (in, -1, -1, null); } catch (HttpException e) { IOException ioe = new MalformedChunkCodingException("Invalid footer: " + e.getMessage()); ExceptionUtils.initCause(ioe, e); throw ioe; } }
/** * Reads and stores the Trailer headers. * @throws IOException If an IO problem occurs */ private void parseTrailerHeaders() throws IOException { try { this.footers = AbstractMessageParser.parseHeaders (in, -1, -1, null); } catch (HttpException e) { IOException ioe = new MalformedChunkCodingException("Invalid footer: " + e.getMessage()); ExceptionUtils.initCause(ioe, e); throw ioe; } }
/** * Reads and stores the Trailer headers. * @throws IOException If an IO problem occurs */ private void parseTrailerHeaders() throws IOException { try { this.footers = AbstractMessageParser.parseHeaders (in, -1, -1, null); } catch (HttpException e) { IOException ioe = new MalformedChunkCodingException("Invalid footer: " + e.getMessage()); ExceptionUtils.initCause(ioe, e); throw ioe; } }
protected void handleException(final HttpException ex, final HttpResponse response) { int code = HttpStatus.SC_INTERNAL_SERVER_ERROR; if (ex instanceof MethodNotSupportedException) { code = HttpStatus.SC_NOT_IMPLEMENTED; } else if (ex instanceof UnsupportedHttpVersionException) { code = HttpStatus.SC_HTTP_VERSION_NOT_SUPPORTED; } else if (ex instanceof ProtocolException) { code = HttpStatus.SC_BAD_REQUEST; } response.setStatusCode(code); byte[] msg = EncodingUtils.getAsciiBytes(ex.getMessage()); ByteArrayEntity entity = new ByteArrayEntity(msg); entity.setContentType("text/plain; charset=US-ASCII"); response.setEntity(entity); }
protected void handleException(final HttpException ex, final HttpResponse response) { if (ex instanceof MethodNotSupportedException) { response.setStatusCode(HttpStatus.SC_NOT_IMPLEMENTED); } else if (ex instanceof UnsupportedHttpVersionException) { response.setStatusCode(HttpStatus.SC_HTTP_VERSION_NOT_SUPPORTED); } else if (ex instanceof ProtocolException) { response.setStatusCode(HttpStatus.SC_BAD_REQUEST); } else { response.setStatusCode(HttpStatus.SC_INTERNAL_SERVER_ERROR); } byte[] msg = EncodingUtils.getAsciiBytes(ex.getMessage()); ByteArrayEntity entity = new ByteArrayEntity(msg); entity.setContentType("text/plain; charset=US-ASCII"); response.setEntity(entity); }
protected void handleException(final HttpException ex, final HttpResponse response) { if (ex instanceof MethodNotSupportedException) { response.setStatusCode(HttpStatus.SC_NOT_IMPLEMENTED); } else if (ex instanceof UnsupportedHttpVersionException) { response.setStatusCode(HttpStatus.SC_HTTP_VERSION_NOT_SUPPORTED); } else if (ex instanceof ProtocolException) { response.setStatusCode(HttpStatus.SC_BAD_REQUEST); } else { response.setStatusCode(HttpStatus.SC_INTERNAL_SERVER_ERROR); } byte[] msg = EncodingUtils.getAsciiBytes(ex.getMessage()); ByteArrayEntity entity = new ByteArrayEntity(msg); entity.setContentType("text/plain; charset=US-ASCII"); response.setEntity(entity); }