From 2cbe992b4f8680a9bcbf2af5280154056c95ead9 Mon Sep 17 00:00:00 2001 From: bdaniel Date: Thu, 25 Feb 2010 05:03:20 +0000 Subject: Exception handling in TransactionInterceptor git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@916126 13f79535-47bb-0310-9956-ffa450edef68 --- .../policy/transaction/runtime/TransactionInterceptor.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'sca-java-2.x/trunk/modules') diff --git a/sca-java-2.x/trunk/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionInterceptor.java b/sca-java-2.x/trunk/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionInterceptor.java index 9488475b12..0d72fa5520 100644 --- a/sca-java-2.x/trunk/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionInterceptor.java +++ b/sca-java-2.x/trunk/modules/policy-transaction/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionInterceptor.java @@ -104,9 +104,17 @@ public class TransactionInterceptor implements PhasedInterceptor { } else { result = helper.handlesInbound(interactionIntent, implementationIntent, invocation); } - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); + + } catch (Throwable e) { + if (e instanceof Error) { + throw (Error)e; + } else if (e instanceof RuntimeException) { + throw (RuntimeException)e; + } else { + result = msg; + msg.setFaultBody(e); + } + } return result; } -- cgit v1.2.3