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 416E9200C23 for ; Wed, 22 Feb 2017 11:05:09 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 402E0160B67; Wed, 22 Feb 2017 10:05:09 +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 912FB160B49 for ; Wed, 22 Feb 2017 11:05:08 +0100 (CET) Received: (qmail 82364 invoked by uid 500); 22 Feb 2017 10:05:06 -0000 Mailing-List: contact users-help@deltaspike.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@deltaspike.apache.org Delivered-To: mailing list users@deltaspike.apache.org Received: (qmail 81234 invoked by uid 99); 22 Feb 2017 10:05:05 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Feb 2017 10:05:05 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 83899186112 for ; Wed, 22 Feb 2017 10:05:05 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.999 X-Spam-Level: * X-Spam-Status: No, score=1.999 tagged_above=-999 required=6.31 tests=[HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id swvbCaxQoj_t for ; Wed, 22 Feb 2017 10:05:04 +0000 (UTC) Received: from mailrelayb.smals.be (mailrelayb.smals.be [85.91.166.7]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 09D2F5F1EE for ; Wed, 22 Feb 2017 10:05:03 +0000 (UTC) Received: from mailrelayb.smals.be (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AF028FC720 for ; Wed, 22 Feb 2017 11:04:49 +0100 (CET) Received: from smtp-01.xtra.onerva.fgov.be (unknown [85.91.187.21]) by mailrelayb.smals.be (Postfix) with ESMTP id AB75BFC5E8 for ; Wed, 22 Feb 2017 11:04:49 +0100 (CET) Received: from mail-01.hbac.onerva.fgov.be ([172.25.200.32]) by smtp-01.xtra.onerva.fgov.be (Lotus Domino Release 8.5.3FP3) with ESMTP id 2017022211044733-77233 ; Wed, 22 Feb 2017 11:04:47 +0100 To: users@deltaspike.apache.org Subject: Exception handling loss of the root cause. Message-ID: From: "Vincent Biertho" Date: Wed, 22 Feb 2017 11:04:47 +0100 MIME-Version: 1.0 X-KeepSent: 2BE5C858:24BB3CE5-C12580CF:003680C2; type=4; flags=0; name=$KeepSent X-Mailer: Lotus Notes Release 8.5.3FP6 November 22, 2013 X-Disclaimed: 32747 X-MIMETrack: CD-MIME by Router on MAIL-01/RVA(Release 8.5.3FP3|November 15, 2012) at 22/02/2017 11:04:48, CD-MIME complete at 22/02/2017 11:04:48, Itemize by Router on MAIL-01/RVA(Release 8.5.3FP3|November 15, 2012) at 22/02/2017 11:04:48, Itemize by SMTP Server on SMTP-01/Servers/EXT-RVAONEM(Release 8.5.3FP3|November 15, 2012) at 22/02/2017 11:04:47, Serialize by Router on SMTP-01/Servers/EXT-RVAONEM(Release 8.5.3FP3|November 15, 2012) at 22/02/2017 11:04:48, Serialize complete at 22/02/2017 11:04:48 X-TNEFEvaluated: 1 Content-type: multipart/alternative; Boundary="0__=4EBB0A5CDFA506528f9e8a93df938690918c4EBB0A5CDFA50652" Content-Disposition: inline X-TM-AS-GCONF: 00 archived-at: Wed, 22 Feb 2017 10:05:09 -0000 --0__=4EBB0A5CDFA506528f9e8a93df938690918c4EBB0A5CDFA50652 Content-Transfer-Encoding: quoted-printable Content-type: text/plain; charset=ISO-8859-1 Hi, There is a strange behaviour in the exception handling... Looking the org.apache.deltaspike.core.api.exception.control.event. ExceptionStackEvent.init() line 96 current =3D exceptionStackItems.removeFirst().getThrowable(); This removes the first original exception when handling exception events... Then when throwing this anywhere: throw new RuntimeException("RootCause", new RuntimeException("previous cause")); or in a normal catch block } catch (final Exception ex) { =A0 =A0 =A0 =A0 =A0 =A0 throw new CustomException("previous cause",ex); } A method with a param @Handles final ExceptionEvent evt will give the "previous cause" exception... not the RootCause when evt .getException(); is called This behaviour and loss of information is really anoying ... Is this a wanted or a bug ? Vincent Biertho Java Team ONEm/RVA vincent.biertho@onem.be 02/515.44.01Disclaimer --0__=4EBB0A5CDFA506528f9e8a93df938690918c4EBB0A5CDFA50652--