Fix clobbering of RuntimeExc with null causing later NPE

git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@679644 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
scottkurz 2008-07-25 02:03:21 +00:00
parent a68dee0727
commit 56ecac6977

View file

@ -96,12 +96,14 @@ public class DataTransformationInterceptor implements Interceptor, DataExchangeS
Object transformedFault = null;
if ((result instanceof Exception) && !(result instanceof RuntimeException)) {
transformedFault = faultTransformHelper.transformFault(result, sourceOperation, targetOperation, wire);
if (transformedFault != result) {
resultMsg.setFaultBody(transformedFault);
}
}
// Otherwise, we leave it to another layer to actually throw the RuntimeException which constitutes
//
// Leave it to another layer to actually throw the Exception which constitutes
// the message body. We don't throw it here.
if (transformedFault != result) {
resultMsg.setFaultBody(transformedFault);
}
//
} else {
assert !(result instanceof Throwable) : "Expected messages that are not throwable " + result;
Object newResult = transform(result, targetType, sourceType, true);