Return-Path: X-Original-To: apmail-hc-commits-archive@www.apache.org Delivered-To: apmail-hc-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B9A181772F for ; Wed, 8 Oct 2014 07:36:40 +0000 (UTC) Received: (qmail 15480 invoked by uid 500); 8 Oct 2014 07:36:40 -0000 Delivered-To: apmail-hc-commits-archive@hc.apache.org Received: (qmail 15441 invoked by uid 500); 8 Oct 2014 07:36:40 -0000 Mailing-List: contact commits-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpComponents Project" Delivered-To: mailing list commits@hc.apache.org Received: (qmail 15432 invoked by uid 99); 8 Oct 2014 07:36:40 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Oct 2014 07:36:40 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Oct 2014 07:36:18 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 428432388993 for ; Wed, 8 Oct 2014 07:36:17 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1630023 - /httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncService.java Date: Wed, 08 Oct 2014 07:36:17 -0000 To: commits@hc.apache.org From: olegk@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20141008073617.428432388993@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: olegk Date: Wed Oct 8 07:36:16 2014 New Revision: 1630023 URL: http://svn.apache.org/r1630023 Log: Create PipelineEntry with exception object on exception in request handler Contributed by Dmitry Potapov Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncService.java Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncService.java URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncService.java?rev=1630023&r1=1630022&r2=1630023&view=diff ============================================================================== --- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncService.java (original) +++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncService.java Wed Oct 8 07:36:16 2014 @@ -443,7 +443,21 @@ public class HttpAsyncService implements request, response, state, conn, context); final HttpAsyncRequestHandler handler = pipelineEntry.getHandler(); conn.suspendOutput(); - handler.handle(result, httpExchange, context); + try { + handler.handle(result, httpExchange, context); + } catch (RuntimeException ex) { + throw ex; + } catch (Exception ex) { + pipeline.add(new PipelineEntry( + request, + null, + ex, + handler, + context)); + state.setResponseState(MessageState.READY); + responseReady(conn); + return; + } } else { final Exception exception = pipelineEntry.getException(); final HttpAsyncResponseProducer responseProducer = handleException(