From ff2090ae5396134fb0c44b90c6599ab15baf8ff8 Mon Sep 17 00:00:00 2001 From: slaws Date: Thu, 23 Dec 2010 13:06:07 +0000 Subject: Throw systematic errors as ServiceRuntimeExceptions git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1052256 13f79535-47bb-0310-9956-ffa450edef68 --- .../tuscany/sca/core/invocation/RuntimeInvoker.java | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'sca-java-2.x/trunk/modules/core') diff --git a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/RuntimeInvoker.java b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/RuntimeInvoker.java index 62593ba895..34c00dbb94 100644 --- a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/RuntimeInvoker.java +++ b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/RuntimeInvoker.java @@ -178,10 +178,7 @@ public class RuntimeInvoker implements Invoker, InvokerAsyncRequest { // temporary fix to swallow the dummy exception that's // thrown back to get past the response chain processing. if (!(ex instanceof AsyncResponseException)){ - // send the exception in through the - // async response processing path - msg.setFaultBody(ex); - invokeAsyncResponse(msg); + throw new ServiceRuntimeException(ex); } } } finally { @@ -200,11 +197,15 @@ public class RuntimeInvoker implements Invoker, InvokerAsyncRequest { public void invokeAsyncResponse(Message msg) { InvocationChain chain = invocable.getInvocationChain(msg.getOperation()); Invoker tailInvoker = chain.getTailInvoker(); - ((InvokerAsyncResponse)tailInvoker).invokeAsyncResponse(msg); + try { + ((InvokerAsyncResponse)tailInvoker).invokeAsyncResponse(msg); + } catch (Throwable ex) { + throw new ServiceRuntimeException(ex); + } } // end method invokeAsyncResponse - @Override - public void invokeAsyncRequest(Message msg) throws Throwable { - invokeAsync(msg); - } // end method invokeAsyncRequest + @Override + public void invokeAsyncRequest(Message msg) throws Throwable { + invokeAsync(msg); + } // end method invokeAsyncRequest } -- cgit v1.2.3