final boolean throwRuntime = transactional && (ex instanceof RuntimeException) ;
if (ex instanceof ActionProcessingFaultException)
{
ActionProcessingFaultException fault = (ActionProcessingFaultException) ex;
if (fault.getFaultMessage() == null)
{
faultTo(callDetails, Factory.createErrorMessage(Factory.PROCESSING_ERROR, message, ex));
}
else
faultTo(callDetails, fault.getFaultMessage());
}
else if (!throwRuntime)
{
faultTo(callDetails, Factory.createErrorMessage(Factory.UNEXPECTED_ERROR, message, ex));
}