Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-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 708BC1986D for ; Fri, 25 Mar 2016 05:02:56 +0000 (UTC) Received: (qmail 31786 invoked by uid 500); 25 Mar 2016 05:02:56 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 31683 invoked by uid 500); 25 Mar 2016 05:02:55 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 31674 invoked by uid 99); 25 Mar 2016 05:02:55 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 Mar 2016 05:02:55 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id A4715DFBA0; Fri, 25 Mar 2016 05:02:55 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ema@apache.org To: commits@cxf.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: cxf git commit: [CXF-6842]:Unwrap exception nested with WebApplicationException Date: Fri, 25 Mar 2016 05:02:55 +0000 (UTC) Repository: cxf Updated Branches: refs/heads/master 66447a377 -> 0566a4ea0 [CXF-6842]:Unwrap exception nested with WebApplicationException Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/0566a4ea Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/0566a4ea Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/0566a4ea Branch: refs/heads/master Commit: 0566a4ea07c8cb9ad819890507519cc120edb5ad Parents: 66447a3 Author: Jim Ma Authored: Fri Mar 25 13:02:35 2016 +0800 Committer: Jim Ma Committed: Fri Mar 25 13:02:35 2016 +0800 ---------------------------------------------------------------------- .../main/java/org/apache/cxf/jaxrs/utils/ExceptionUtils.java | 7 +++++++ 1 file changed, 7 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/0566a4ea/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/ExceptionUtils.java ---------------------------------------------------------------------- diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/ExceptionUtils.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/ExceptionUtils.java index 5e9c257..71cad74 100644 --- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/ExceptionUtils.java +++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/ExceptionUtils.java @@ -91,6 +91,13 @@ public final class ExceptionUtils { } } } + if (response == null) { + Throwable unwrappedException = ex.getCause(); + if (unwrappedException instanceof WebApplicationException) { + WebApplicationException webEx = (WebApplicationException)unwrappedException; + return webEx.getResponse(); + } + } JAXRSUtils.setMessageContentType(currentMessage, response); return response; }