Return-Path: X-Original-To: apmail-cxf-issues-archive@www.apache.org Delivered-To: apmail-cxf-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 18405D239 for ; Wed, 26 Sep 2012 18:27:09 +0000 (UTC) Received: (qmail 54493 invoked by uid 500); 26 Sep 2012 18:27:08 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 54453 invoked by uid 500); 26 Sep 2012 18:27:08 -0000 Mailing-List: contact issues-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 issues@cxf.apache.org Received: (qmail 54288 invoked by uid 99); 26 Sep 2012 18:27:07 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Sep 2012 18:27:07 +0000 Date: Thu, 27 Sep 2012 05:27:07 +1100 (NCT) From: "Jonathan S Fisher (JIRA)" To: issues@cxf.apache.org Message-ID: <1624821707.129769.1348684027898.JavaMail.jiratomcat@arcas> In-Reply-To: <20699671.30834.1346692987869.JavaMail.jiratomcat@arcas> Subject: [jira] [Commented] (CXF-4496) find of ResponseExceptionMapper do not handle runtime exceptions MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CXF-4496?page=3Dcom.atlassian.j= ira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D134640= 26#comment-13464026 ]=20 Jonathan S Fisher commented on CXF-4496: ---------------------------------------- This is a fairly simple fix, any chance this could be included in the next = release? =20 > find of ResponseExceptionMapper do not handle runtime exceptions > ---------------------------------------------------------------- > > Key: CXF-4496 > URL: https://issues.apache.org/jira/browse/CXF-4496 > Project: CXF > Issue Type: Bug > Components: JAX-RS > Affects Versions: 2.6.2 > Reporter: n0rad > Priority: Minor > > In org.apache.cxf.jaxrs.client.ClientProxyImpl.findExceptionMapper(Method= , Message) > The responseExceptionMapper is selected based on exception defined in the= resource method signature but this method may have thrown a RuntimeExcepti= on : > {code:java}=20 > @Path("/") > public interface RestMcuBoardResource { > @GET > public RestMcuBoard getBoard(); > } > {code}=C2=A0 > does not work where this one work > {code:java}=20 > @Path("/") > public interface RestMcuBoardResource { > @GET > public RestMcuBoard getBoard() throws runtimeException; > } > {code} > a fix could be : > {code:java}=20 > private static ResponseExceptionMapper findExceptionMapper(Method = m, Message message) { > ProviderFactory pf =3D ProviderFactory.getInstance(message); > for (Class exType : m.getExceptionTypes()) { > ResponseExceptionMapper mapper =3D pf.createResponseExcept= ionMapper(exType); > if (mapper !=3D null) { > return mapper; > } > } > + return pf.createResponseExceptionMapper(RuntimeException.class); > - return null;=20 > } > {code}=20 -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrato= rs For more information on JIRA, see: http://www.atlassian.com/software/jira