Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 40FF5200BB7 for ; Wed, 9 Nov 2016 18:47:01 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 3FAF0160AFA; Wed, 9 Nov 2016 17:47:01 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 85696160AEB for ; Wed, 9 Nov 2016 18:47:00 +0100 (CET) Received: (qmail 87301 invoked by uid 500); 9 Nov 2016 17:46:59 -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 87287 invoked by uid 99); 9 Nov 2016 17:46:59 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Nov 2016 17:46:59 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 956D32C0D55 for ; Wed, 9 Nov 2016 17:46:59 +0000 (UTC) Date: Wed, 9 Nov 2016 17:46:59 +0000 (UTC) From: "Sergey Beryozkin (JIRA)" To: issues@cxf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CXF-7119) ResponseExceptionMapper not used for technical exceptions (e.g. IOException) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 09 Nov 2016 17:47:01 -0000 [ https://issues.apache.org/jira/browse/CXF-7119?page=3Dcom.atlassian.j= ira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D156515= 54#comment-15651554 ]=20 Sergey Beryozkin commented on CXF-7119: --------------------------------------- Can you please get back to me and explain why catching ProcessingException = and get its IOException cause is not ideal in your case ? The only other al= ternative that I can see is to return a custom RuntimeException instead - i= s it what you are after ? > ResponseExceptionMapper not used for technical exceptions (e.g. IOExcepti= on) > -------------------------------------------------------------------------= --- > > Key: CXF-7119 > URL: https://issues.apache.org/jira/browse/CXF-7119 > Project: CXF > Issue Type: Bug > Components: JAX-RS > Affects Versions: 3.1.3 > Reporter: J=C3=B6rg Hohwiller > > When using CXF for REST/JAX-RS service clients I quickly noticed that I n= eed to tweak the error handling. My services use an ExceptionMapper that pr= ovides error details via JSON result payload. Hence I want to access this a= nd render an exception with further details and more context information wh= at works fine with ResponseExceptionMapper.=20 > However, when a technical error (IOException such as unkown host, connect= ion refused, timeout, etc.) occurrs I only get generic errors from CXF clie= nt (org.apache.cxf.interceptor.Fault: Could not send Message.). This is und= esired but unfortunately my custom ResponseExceptionMapper is never called = for such technical errors. There seems to be no way to archive my goal with= CXF itself. I could only wrap the client again with a custom written dynam= ic proxy to reach my goal. > It seems that CXF hardwires this behaviour: > https://github.com/apache/cxf/blob/master/rt/rs/client/src/main/java/org/= apache/cxf/jaxrs/client/AbstractClient.java#L596 > https://github.com/apache/cxf/blob/master/core/src/main/java/org/apache/c= xf/interceptor/MessageSenderInterceptor.java#L64 > It would be awesome if in such case ResponseExceptionMapper would also be= applied so I have the chance to interfere and produce better exceptions (e= .g. with a message containing the name of the application/microservice that= could not be called, the URL, etc.) for my individual needs. -- This message was sent by Atlassian JIRA (v6.3.4#6332)