Permalink
Browse files

[SMX4-1719]NMRDestination would miss return exception in OutIntercept…

…orChain in some cases

git-svn-id: https://svn.apache.org/repos/asf/servicemix/smx4/features/trunk@1576230 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
1 parent 52a66fd commit 543dda985806e42702091722bee7599c3d85d288 @ffang ffang committed Mar 11, 2014
View
18 ...nmr/src/main/java/org/apache/servicemix/cxf/transport/nmr/NMRDestinationOutputStream.java
@@ -78,9 +78,25 @@ private void commitOutputMessage() throws IOException {
return;
} else {
InputStream bais = getInputStream();
+ Exchange xchng = inMessage.get(Exchange.class);
+ if (inMessage.getExchange().getOutFaultMessage() != null
+ && inMessage.getExchange().getOutFaultMessage().getContent(Exception.class) != null) {
+ //check if there is an OutFaultMessage and Exception here first and return the Error fast
+ Exception ex = inMessage.getExchange().getOutFaultMessage().getContent(Exception.class);
+ if (ex instanceof org.apache.cxf.interceptor.Fault) {
+ org.apache.cxf.interceptor.Fault f = (org.apache.cxf.interceptor.Fault)ex;
+ if (!f.hasDetails()) {
+ xchng.setError(f);
+ }
+ } else {
+ xchng.setError(ex);
+ }
+ channel.send(xchng);
+ return;
+ }
+
StreamSource ss = new StreamSource(bais);
- Exchange xchng = inMessage.get(Exchange.class);
LOG.fine(new org.apache.cxf.common.i18n.Message("CREATE.NORMALIZED.MESSAGE", LOG).toString());
if (inMessage.getExchange().getOutFaultMessage() != null) {
Exception ex = inMessage.getContent(Exception.class);

0 comments on commit 543dda9

Please sign in to comment.